summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-01-22 16:48:31 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-01-22 16:48:31 +0100
commit873f8021346415b106492cfbbb08dbb3a22f0543 (patch)
treec4f66b2101cd7cfd9082e8b71d24c346fc996df4
parent7e8f4f490bcc4b19e4194e8ae75984207eb33426 (diff)
downloadpsutil-873f8021346415b106492cfbbb08dbb3a22f0543.tar.gz
try to fix 'RuntimeError: No active exception to reraise'
-rw-r--r--test/test_psutil.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_psutil.py b/test/test_psutil.py
index 1bff2064..5d37fc32 100644
--- a/test/test_psutil.py
+++ b/test/test_psutil.py
@@ -460,12 +460,13 @@ def retry_before_failing(ntimes=None):
def wrapper(*args, **kwargs):
times = ntimes or NO_RETRIES
assert times, times
+ exc = None
for x in range(times):
try:
return fun(*args, **kwargs)
- except AssertionError:
- pass
- raise
+ except AssertionError as _:
+ exc = _
+ raise exc
return wrapper
return decorator