Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore old file
  • Loading branch information
pablogsal committed Jun 11, 2024
commit 097f21e1b7eca323043a374775a5eec184de9a87
8 changes: 6 additions & 2 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,14 @@ def register_readline():
pass

def write_history():
from _pyrepl.main import IS_USING_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 IS_USING_PYREPL:
if os.getenv("PYTHON_BASIC_REPL") or not CAN_USE_PYREPL:
readline.write_history_file(history)
else:
_pyrepl.readline.write_history_file(history)
Expand Down