]> granicus.if.org Git - python/commitdiff
Issue 6581. Michael Foord
authorMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 26 Jul 2009 21:11:42 +0000 (21:11 +0000)
committerMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 26 Jul 2009 21:11:42 +0000 (21:11 +0000)
Lib/inspect.py

index 1685bfc98d415d799f7ab3b421b4991439a48bfc..318fa078e1dc3ae232d3657f6c9edfc1f362a94b 100644 (file)
@@ -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."""