Skip to content

gh-129098: Skip reading source lines if filename is _pyrepl.__main__.py inside REPL #129099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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
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
Loading