Skip to content

Commit 335670b

Browse files
skirpichevhroncok
andcommitted
00430: pythongh-121245: Amend d611c4c (correct import)
This prevents writing incorrect history (empty). Co-authored-by: Miro Hrončok <[email protected]>
1 parent 4de40e3 commit 335670b

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
@@ -533,8 +533,7 @@ def register_readline():
533533

534534
def write_history():
535535
try:
536-
# _pyrepl.__main__ is executed as the __main__ module
537-
from __main__ import CAN_USE_PYREPL
536+
from _pyrepl.main import CAN_USE_PYREPL
538537
except ImportError:
539538
CAN_USE_PYREPL = False
540539

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)