Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Skip reading source lines if filename is _pyrepl.__main__ inside REPL
  • Loading branch information
WolframAlph committed Jan 20, 2025
commit cb54084ce6649baaabedc88e32efaa9eaa401193
2 changes: 2 additions & 0 deletions Lib/linecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def lazycache(filename, module_globals):
if module_globals and '__name__' in module_globals:
spec = module_globals.get('__spec__')
name = getattr(spec, 'name', None) or module_globals['__name__']
if name == "_pyrepl.__main__":
return False
loader = getattr(spec, 'loader', None)
if loader is None:
loader = module_globals.get('__loader__')
Expand Down