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

index 3305c8d0400782dc53bbf9dcc47b964617cf2ab2..30ee670cb6cfc7295a3bb03c75ef98bc50e080f7 100644 (file)
@@ -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."""