don't alias directly, so that extra arguments don't appear #6678
diff --git a/Lib/inspect.py b/Lib/inspect.py
index bfb6d00..1690f94 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1062,10 +1062,9 @@
tb = tb.tb_next
return framelist
-if hasattr(sys, '_getframe'):
- currentframe = sys._getframe
-else:
- currentframe = lambda _=None: None
+def currentframe():
+ """Return the frame or the caller or None if this is not possible."""
+ return sys._getframe(1) if hasattr(sys, "_getframe") else None
def stack(context=1):
"""Return a list of records for the stack above the caller's frame."""