From: Erlend E. Aasland Date: Thu, 27 Apr 2023 21:22:26 +0000 (+0200) Subject: gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945) X-Git-Tag: v3.12.0b1~381 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56c7176d1de3a0770085cad3865c1de42ba86f42;p=thirdparty%2FPython%2Fcpython.git gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945) --- diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py index 9f57e7d6d58c..3228dbc09d50 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}