diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-26 21:11:42 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-26 21:11:42 (GMT) |
commit | 133ebff5c854a50f0dcfb624d8930166bc4cf7d3 (patch) | |
tree | 8a58448c4872d960206bf69e1c07569f6ea9537f /Lib/inspect.py | |
parent | 308681c405177dd893384bb039854c08c88e852c (diff) | |
download | cpython-133ebff5c854a50f0dcfb624d8930166bc4cf7d3.zip cpython-133ebff5c854a50f0dcfb624d8930166bc4cf7d3.tar.gz cpython-133ebff5c854a50f0dcfb624d8930166bc4cf7d3.tar.bz2 |
Issue 6581. Michael Foord
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 1685bfc..318fa07 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.""" |