diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-26 21:12:14 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-26 21:12:14 (GMT) |
commit | fb0e0570f7ad0c5a02ee6dbfc83b37fd10a65de7 (patch) | |
tree | b13e905642325826051c10570625c5166113398e | |
parent | 3591a8f81d6040b419ce8cc82fde4c6bc312f5fc (diff) | |
download | cpython-fb0e0570f7ad0c5a02ee6dbfc83b37fd10a65de7.zip cpython-fb0e0570f7ad0c5a02ee6dbfc83b37fd10a65de7.tar.gz cpython-fb0e0570f7ad0c5a02ee6dbfc83b37fd10a65de7.tar.bz2 |
Issue 6581. Michael Foord
-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 3305c8d..30ee670 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.""" |