Message4078
Logged In: YES
user_id=44345
I believe the following patch is correct for the try/except
in inspect.currentframe. Note that it fixes two problems.
One, it avoids a bare except. Two, it gets rid of a string
argument to the raise statement (string exceptions are now
deprecated, right?).
*** /tmp/skip/inspect.py Thu Apr 19 04:13:36 2001
--- /tmp/skip/inspect.py.~1.16~ Thu Apr 19 04:13:36 2001
***************
*** 643,650 ****
def currentframe():
"""Return the frame object for the caller's stack
frame."""
try:
! 1/0
! except ZeroDivisionError:
return sys.exc_traceback.tb_frame.f_back
if hasattr(sys, '_getframe'): currentframe = sys._getframe
--- 643,650 ----
def currentframe():
"""Return the frame object for the caller's stack
frame."""
try:
! raise 'catch me'
! except:
return sys.exc_traceback.tb_frame.f_back
if hasattr(sys, '_getframe'): currentframe = sys._getframe
|
|
Date |
User |
Action |
Args |
2007-08-23 13:53:44 | admin | link | issue411881 messages |
2007-08-23 13:53:44 | admin | create | |
|