Skip to content

Commit 78e96bd

Browse files
miss-islingtonskirpichevhroncok
authored
[3.13] gh-121245: Correct pyrepl import in site.py (GH-121255) (#121261)
(cherry picked from commit 7a807c3) Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Miro Hrončok <[email protected]>
1 parent 78c7732 commit 78e96bd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/site.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,7 @@ def register_readline():
526526

527527
def write_history():
528528
try:
529-
# _pyrepl.__main__ is executed as the __main__ module
530-
from __main__ import CAN_USE_PYREPL
529+
from _pyrepl.main import CAN_USE_PYREPL
531530
except ImportError:
532531
CAN_USE_PYREPL = False
533532

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a bug in the handling of the command history of the new :term:`REPL` that caused
2+
the history file to be wiped at REPL exit.

0 commit comments

Comments
 (0)