diff options
author | Jürg Billeter <j@bitron.ch> | 2019-07-09 15:30:40 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-07-16 15:36:10 +0200 |
commit | 863d9c6b28aae5b13849edde4c89ad186d4fa0f3 (patch) | |
tree | 7df229e01c67626c8da325a440a8db0fa13d226a /src/buildstream/_context.py | |
parent | 0f1938dd6b263fcf754221815986b3cee5cde9c9 (diff) | |
download | buildstream-863d9c6b28aae5b13849edde4c89ad186d4fa0f3.tar.gz |
_context.py: Make Context class a Python context manager
This will allow reliable cleanup.
Diffstat (limited to 'src/buildstream/_context.py')
-rw-r--r-- | src/buildstream/_context.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py index 286ed6d3d..1e45d776d 100644 --- a/src/buildstream/_context.py +++ b/src/buildstream/_context.py @@ -164,6 +164,20 @@ class Context(): self._cascache = None self._casquota = None + # __enter__() + # + # Called when entering the with-statement context. + # + def __enter__(self): + return self + + # __exit__() + # + # Called when exiting the with-statement context. + # + def __exit__(self, exc_type, exc_value, traceback): + return None + # load() # # Loads the configuration files |