[Python-checkins] r74216 - python/trunk/Lib/inspect.py

michael.foord python-checkins at python.org
Sun Jul 26 23:12:14 CEST 2009


Author: michael.foord
Date: Sun Jul 26 23:12:14 2009
New Revision: 74216

Log:
Issue 6581. Michael Foord

Modified:
   python/trunk/Lib/inspect.py

Modified: python/trunk/Lib/inspect.py
==============================================================================
--- python/trunk/Lib/inspect.py	(original)
+++ python/trunk/Lib/inspect.py	Sun Jul 26 23:12:14 2009
@@ -952,7 +952,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."""


More information about the Python-checkins mailing list