mirror of
https://github.com/python/cpython.git
synced 2025-09-19 23:20:25 +00:00
gh-119102: Fix REPL for dumb terminal (#119269)
Use CAN_USE_PYREPL of _pyrepl.__main__ in the site module to decide if _pyrepl.write_history_file() can be used.
This commit is contained in:
parent
b365332906
commit
73f4a58d36
1 changed files with 2 additions and 1 deletions
|
@ -523,8 +523,9 @@ def register_readline():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def write_history():
|
def write_history():
|
||||||
|
from _pyrepl.__main__ import CAN_USE_PYREPL
|
||||||
try:
|
try:
|
||||||
if os.getenv("PYTHON_BASIC_REPL"):
|
if os.getenv("PYTHON_BASIC_REPL") or not CAN_USE_PYREPL:
|
||||||
readline.write_history_file(history)
|
readline.write_history_file(history)
|
||||||
else:
|
else:
|
||||||
_pyrepl.readline.write_history_file(history)
|
_pyrepl.readline.write_history_file(history)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue