aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/types.py
diff options
context:
space:
mode:
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 5254ebc97d6..aeac304d6d9 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)