From 1bdf0451a0b74612660686f5cf31cbc5549506e1 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 23 Oct 2017 18:45:25 +0900 Subject: exceptions.py: _get_last_exception() clear the exception after fetching it Ensure test cases dont have remnent exceptions from a previous test. --- buildstream/exceptions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1