]> granicus.if.org Git - python/commitdiff
tighten up unqualified except in currentframe()
authorSkip Montanaro <skip@pobox.com>
Mon, 25 Mar 2002 21:37:54 +0000 (21:37 +0000)
committerSkip Montanaro <skip@pobox.com>
Mon, 25 Mar 2002 21:37:54 +0000 (21:37 +0000)
see bug 411881

Lib/inspect.py

index e4f6b575e0f976f376f0be43917cbf5c95006393..175f5d6eb17f434d2a79034782a5acfe58a0deda 100644 (file)
@@ -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