diff --git a/procrastinate/worker.py b/procrastinate/worker.py index bd95611c7..e3d712563 100644 --- a/procrastinate/worker.py +++ b/procrastinate/worker.py @@ -172,7 +172,7 @@ def find_exception_to_re_raise( # (e.g. a CancelledError, SystemExit, etc.) then we want to persist the # outcome of the job before propagating the exception further up the # call stack. - return ex.__cause__ if not isinstance(e.__cause__, Exception) else None + return ex.__cause__ if not isinstance(ex.__cause__, Exception) else None status, retry_at = None, None exception_to_re_raise = None