summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
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 4b3e27a..79565c1 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -990,7 +990,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."""