]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121245: Amend d611c4c8e9 (correct import) (#121255)
authorSergey B Kirpichev <skirpichev@gmail.com>
Tue, 2 Jul 2024 09:40:01 +0000 (12:40 +0300)
committerGitHub <noreply@github.com>
Tue, 2 Jul 2024 09:40:01 +0000 (09:40 +0000)
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
Lib/site.py
Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst [new file with mode: 0644]

index 9381f6f510eb46d1e7d71a34ed1eec09a91a5e2a..daa56e158949dbdc987ea35414dd508a7741405a 100644 (file)
@@ -526,8 +526,7 @@ def register_readline():
 
         def write_history():
             try:
-                # _pyrepl.__main__ is executed as the __main__ module
-                from __main__ import CAN_USE_PYREPL
+                from _pyrepl.main import CAN_USE_PYREPL
             except ImportError:
                 CAN_USE_PYREPL = False
 
diff --git a/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst
new file mode 100644 (file)
index 0000000..6e9dec2
--- /dev/null
@@ -0,0 +1,2 @@
+Fix a bug in the handling of the command history of the new :term:`REPL` that caused
+the history file to be wiped at REPL exit.