summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2009-07-26 21:11:42 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2009-07-26 21:11:42 (GMT)
commit133ebff5c854a50f0dcfb624d8930166bc4cf7d3 (patch)
tree8a58448c4872d960206bf69e1c07569f6ea9537f /Lib/inspect.py
parent308681c405177dd893384bb039854c08c88e852c (diff)
downloadcpython-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.py5
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."""