commit | 133ebff5c854a50f0dcfb624d8930166bc4cf7d3 | [log] [tgz] |
---|---|---|
author | Michael Foord <fuzzyman@voidspace.org.uk> | Sun Jul 26 21:11:42 2009 +0000 |
committer | Michael Foord <fuzzyman@voidspace.org.uk> | Sun Jul 26 21:11:42 2009 +0000 |
tree | 8a58448c4872d960206bf69e1c07569f6ea9537f | |
parent | 308681c405177dd893384bb039854c08c88e852c [diff] [blame] |
Issue 6581. Michael Foord
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 @@ 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."""