From: Michael Foord Date: Sun, 26 Jul 2009 21:12:14 +0000 (+0000) Subject: Issue 6581. Michael Foord X-Git-Tag: v2.7a1~706 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb0e0570f7ad0c5a02ee6dbfc83b37fd10a65de7;p=thirdparty%2FPython%2Fcpython.git Issue 6581. Michael Foord --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 3305c8d04007..30ee670cb6cf 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -952,7 +952,10 @@ def getinnerframes(tb, context=1): tb = tb.tb_next return framelist -currentframe = sys._getframe +if hasattr(sys, '_getframe'): + currentframe = sys._getframe +else: + currentframe = lambda _=None: None def stack(context=1): """Return a list of records for the stack above the caller's frame."""