Skip to content

Commit 3582925

Browse files
committed
Use threading.excepthook instead of sys.excepthook
1 parent c7b3d39 commit 3582925

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/multiprocessing/pool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import itertools
1818
import os
1919
import queue
20-
import sys
2120
import threading
2221
import time
2322
import traceback
@@ -789,7 +788,9 @@ def _handle_exceptions(callback, args):
789788
try:
790789
return callback(args)
791790
except Exception as e:
792-
sys.excepthook(*sys.exc_info())
791+
args = threading.ExceptHookArgs([type(e), e, e.__traceback__, None])
792+
threading.excepthook(args)
793+
del args
793794

794795
__class_getitem__ = classmethod(types.GenericAlias)
795796

0 commit comments

Comments
 (0)