Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37dc157

Browse filesBrowse files
committed
gh-119102: Fix REPL for dumb terminal
Use CAN_USE_PYREPL of _pyrepl.__main__ in the site module to decide if _pyrepl.write_history_file() can be used.
1 parent 9257731 commit 37dc157
Copy full SHA for 37dc157

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎Lib/site.py

Copy file name to clipboardExpand all lines: Lib/site.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,9 @@ def register_readline():
523523
pass
524524

525525
def write_history():
526+
from _pyrepl.__main__ import CAN_USE_PYREPL
526527
try:
527-
if os.getenv("PYTHON_BASIC_REPL"):
528+
if os.getenv("PYTHON_BASIC_REPL") or not CAN_USE_PYREPL:
528529
readline.write_history_file(history)
529530
else:
530531
_pyrepl.readline.write_history_file(history)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.