summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorMario Corchero <mcorcherojim@bloomberg.net>2020-11-12 17:27:44 (GMT)
committerGitHub <noreply@github.com>2020-11-12 17:27:44 (GMT)
commit750c5abf43b7b1627ab59ead237bef4c2314d29e (patch)
treef8ebda9718f8e2b5c7a564a7aaae0e4170639360 /Lib/threading.py
parentb5cc05bbe681dbe06d5ec6d34318815d1c1ad6c5 (diff)
downloadcpython-750c5abf43b7b1627ab59ead237bef4c2314d29e.zip
cpython-750c5abf43b7b1627ab59ead237bef4c2314d29e.tar.gz
cpython-750c5abf43b7b1627ab59ead237bef4c2314d29e.tar.bz2
bpo-42308: Add threading.__excepthook__ (GH-23218)
Add threading.__excepthook__ to allow retrieving the original value of threading.excepthook in case it is set to a broken or a different value.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index d4fe649..7dae77d 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1200,6 +1200,10 @@ except ImportError:
stderr.flush()
+# Original value of threading.excepthook
+__excepthook__ = excepthook
+
+
def _make_invoke_excepthook():
# Create a local namespace to ensure that variables remain alive
# when _invoke_excepthook() is called, even if it is called late during