gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)

This commit is contained in:
Erlend E. Aasland 2023-04-27 23:22:26 +02:00 committed by GitHub
parent 2cf945bec6
commit 56c7176d1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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}