gh-129098: avoid using content of _pyrepl/__main__.py when reporting tracebacks (#130721)

This commit is contained in:
Bénédikt Tran 2025-04-20 19:24:30 +02:00 committed by GitHub
parent 5d8e432d9f
commit 492e3e6976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 2 deletions

View file

@ -1,6 +1,10 @@
# Important: don't add things to this module, as they will end up in the REPL's
# default globals. Use _pyrepl.main instead.
# Avoid caching this file by linecache and incorrectly report tracebacks.
# See https://github.com/python/cpython/issues/129098.
__spec__ = __loader__ = None
if __name__ == "__main__":
from .main import interactive_console as __pyrepl_interactive_console
__pyrepl_interactive_console()