From f15d15964b6ac3e5ff71894707fbcff48bec45b2 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 29 Sep 1997 23:22:12 +0000 Subject: Use sys.exc_info() where needed. --- Lib/types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Lib/types.py') 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) -- cgit v1.2.3