summaryrefslogtreecommitdiff
path: root/buildstream/_context.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-21 22:38:28 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-21 23:38:07 +0900
commit21fe51fbc2095a19e201ccfaad8db3dddf61ccb5 (patch)
tree06ce60f76b0e48451ae31202ff5d5a0ac923973f /buildstream/_context.py
parentcf43f8cff1c1d1e7eccfc438f71f5741c9be3f08 (diff)
downloadbuildstream-21fe51fbc2095a19e201ccfaad8db3dddf61ccb5.tar.gz
_context.py: Fix Context._silence() context manager.
This needs to yield in a try: block, otherwise messages remain silenced after an exception passes through this context manager.
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r--buildstream/_context.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index e98b0761d..15fadddcc 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -349,8 +349,10 @@ class Context():
@contextmanager
def _silence(self):
self._push_message_depth(True)
- yield
- self._pop_message_depth()
+ try:
+ yield
+ finally:
+ self._pop_message_depth()
# _timed_activity()
#