From: Skip Montanaro Date: Mon, 25 Mar 2002 21:37:54 +0000 (+0000) Subject: tighten up unqualified except in currentframe() X-Git-Tag: v2.3c1~6335 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a959a36288120863f2122ac1c226ee965efcec97;p=python tighten up unqualified except in currentframe() see bug 411881 --- diff --git a/Lib/inspect.py b/Lib/inspect.py index e4f6b575e0..175f5d6eb1 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -762,8 +762,8 @@ def getinnerframes(tb, context=1): def currentframe(): """Return the frame object for the caller's stack frame.""" try: - raise 'catch me' - except: + 1/0 + except ZeroDivisionError: return sys.exc_traceback.tb_frame.f_back if hasattr(sys, '_getframe'): currentframe = sys._getframe