diff options
-rw-r--r-- | ipalib/plugins/baseldap.py | 3 | ||||
-rw-r--r-- | ipatests/util.py | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 847db9c21..1c822ecda 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -1148,7 +1148,8 @@ last, after all sets and adds."""), while True: try: return func(*call_args, **call_kwargs) - except errors.ExecutionError as e: + except errors.ExecutionError as exc: + e = exc if not callbacks: raise # call exc_callback in the next loop diff --git a/ipatests/util.py b/ipatests/util.py index 85b5dbc5e..c6566c930 100644 --- a/ipatests/util.py +++ b/ipatests/util.py @@ -370,14 +370,11 @@ def raises(exception, callback, *args, **kw): Tests that the expected exception is raised; raises ExceptionNotRaised if test fails. """ - raised = False try: callback(*args, **kw) except exception as e: - raised = True - if not raised: - raise ExceptionNotRaised(exception) - return e + return e + raise ExceptionNotRaised(exception) def getitem(obj, key): |