From: Michael Foord Date: Sun, 26 Jul 2009 21:11:42 +0000 (+0000) Subject: Issue 6581. Michael Foord X-Git-Tag: v2.6.3rc1~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=133ebff5c854a50f0dcfb624d8930166bc4cf7d3;p=python Issue 6581. Michael Foord --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 1685bfc98d..318fa078e1 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -947,7 +947,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."""