diff options
Diffstat (limited to 'Lib/concurrent/futures/thread.py')
-rw-r--r-- | Lib/concurrent/futures/thread.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 1f0a1d4b977..0b5d5373ffd 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -54,8 +54,10 @@ class _WorkItem(object): try: result = self.fn(*self.args, **self.kwargs) - except BaseException as e: - self.future.set_exception(e) + except BaseException as exc: + self.future.set_exception(exc) + # Break a reference cycle with the exception 'exc' + self = None else: self.future.set_result(result) |