summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-23 18:45:25 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-23 18:45:25 +0900
commit1bdf0451a0b74612660686f5cf31cbc5549506e1 (patch)
tree4fb583ee7e308ece66e6d187ebb6df54dce9fed6
parent72d29f04527e110a7b725bc21bbbc5656077d457 (diff)
downloadbuildstream-1bdf0451a0b74612660686f5cf31cbc5549506e1.tar.gz
exceptions.py: _get_last_exception() clear the exception after fetching it
Ensure test cases dont have remnent exceptions from a previous test.
-rw-r--r--buildstream/exceptions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/buildstream/exceptions.py b/buildstream/exceptions.py
index 7e334a369..5a9cd455d 100644
--- a/buildstream/exceptions.py
+++ b/buildstream/exceptions.py
@@ -30,7 +30,11 @@ _last_exception = None
def _get_last_exception():
- return _last_exception
+ global _last_exception
+
+ le = _last_exception
+ _last_exception = None
+ return le
# BstError is an internal base exception class for BuildSream