Skip to content

Commit da9b900

Browse files
author
Roman Skurikhin
committed
Use set_exception instead of set_exception_info
set_exception_info method is only available in python2 backport of concurrent.futures, while set_exception method available everywhere.
1 parent 42c88fd commit da9b900

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

collapsing_thread_pool_executor/collapsing_thread_pool_executor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ def run(self):
5252

5353
try:
5454
result = self.fn(*self.args, **self.kwargs)
55-
except BaseException:
56-
e, tb = sys.exc_info()[1:]
57-
self.future.set_exception_info(e, tb)
55+
except BaseException as exc:
56+
self.future.set_exception(exc)
5857
else:
5958
self.future.set_result(result)
6059

0 commit comments

Comments
 (0)