We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7a832b commit 51d960eCopy full SHA for 51d960e
Lib/threading.py
@@ -50,7 +50,10 @@
50
_CRLock = None
51
TIMEOUT_MAX = _thread.TIMEOUT_MAX
52
_wait_for_threads_fini = _thread._wait_for_threads_fini
53
-_internal_after_fork = _thread._after_fork
+try:
54
+ _internal_after_fork = _thread._after_fork
55
+except AttributeError:
56
+ _internal_after_fork = None
57
del _thread
58
59
@@ -1683,5 +1686,6 @@ def _after_fork():
1683
1686
1684
1687
1685
1688
if hasattr(_os, "register_at_fork"):
- _os.register_at_fork(after_in_child=_internal_after_fork)
1689
+ if _internal_after_fork is not None:
1690
+ _os.register_at_fork(after_in_child=_internal_after_fork)
1691
_os.register_at_fork(after_in_child=_after_fork)
0 commit comments