https://github.com/python/cpython/commit/f371565169438c3b93763f298d5171985607ab5d commit: f371565169438c3b93763f298d5171985607ab5d branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: lysnikolaou <lisandros...@gmail.com> date: 2024-05-22T00:14:44Z summary:
[3.13] gh-119102: Fix REPL for dumb terminal (GH-119332) (#119359) The site module gets the __main__ module to get _pyrepl.__main__. (cherry picked from commit de8f530841b55885b919677a6938ab33d4a92f20) Co-authored-by: Victor Stinner <vstin...@python.org> files: M Lib/site.py diff --git a/Lib/site.py b/Lib/site.py index 4ba078388a37b8..f1a6d9cf66fdc3 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -523,7 +523,12 @@ def register_readline(): pass def write_history(): - from _pyrepl.__main__ import CAN_USE_PYREPL + try: + # _pyrepl.__main__ is executed as the __main__ module + from __main__ import CAN_USE_PYREPL + except ImportError: + CAN_USE_PYREPL = False + try: if os.getenv("PYTHON_BASIC_REPL") or not CAN_USE_PYREPL: readline.write_history_file(history) _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com