mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
tighten up unqualified except in currentframe()
see bug 411881
This commit is contained in:
parent
2358425146
commit
a959a36288
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue