summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-04-27 21:22:26 (GMT)
committerGitHub <noreply@github.com>2023-04-27 21:22:26 (GMT)
commit56c7176d1de3a0770085cad3865c1de42ba86f42 (patch)
tree2c269f5eb4dd0aa573ac0c6e1f7226ba14936150
parent2cf945bec6cbfe7172c3bb4e1da8b1c3e8a54bc3 (diff)
downloadcpython-56c7176d1de3a0770085cad3865c1de42ba86f42.zip
cpython-56c7176d1de3a0770085cad3865c1de42ba86f42.tar.gz
cpython-56c7176d1de3a0770085cad3865c1de42ba86f42.tar.bz2
gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)
-rw-r--r--Lib/sqlite3/__main__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py
index 9f57e7d..3228dbc 100644
--- a/Lib/sqlite3/__main__.py
+++ b/Lib/sqlite3/__main__.py
@@ -94,7 +94,10 @@ def main():
db_name = repr(args.filename)
# Prepare REPL banner and prompts.
- eofkey = "CTRL-Z" if sys.platform == "win32" else "CTRL-D"
+ if sys.platform == "win32" and "idlelib.run" not in sys.modules:
+ eofkey = "CTRL-Z"
+ else:
+ eofkey = "CTRL-D"
banner = dedent(f"""
sqlite3 shell, running on SQLite version {sqlite3.sqlite_version}
Connected to {db_name}