summaryrefslogtreecommitdiff
path: root/Lib/types.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-09-29 23:22:12 +0000
committerGuido van Rossum <guido@python.org>1997-09-29 23:22:12 +0000
commit50bb80472b8dcbf9e7f0e15db857fb66db15a039 (patch)
tree4816be5e2b57758f7853a06d578bbd8bd9118808 /Lib/types.py
parentfe02ef6d95a3b98b620f6d1c9533434100e9be75 (diff)
downloadcpython-50bb80472b8dcbf9e7f0e15db857fb66db15a039.tar.gz
Use sys.exc_info() where needed.
Diffstat (limited to 'Lib/types.py')
-rw-r--r--Lib/types.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/types.py b/Lib/types.py
index 5254ebc97d..aeac304d6d 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -51,10 +51,12 @@ try:
raise TypeError
except TypeError:
try:
- TracebackType = type(sys.exc_traceback)
- FrameType = type(sys.exc_traceback.tb_frame)
+ tb = sys.exc_info()[2]
+ TracebackType = type(tb)
+ FrameType = type(tb.tb_frame)
except:
pass
+ tb = None; del tb
SliceType = type(slice(0))
EllipsisType = type(Ellipsis)