]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Thu, 27 Apr 2023 21:22:26 +0000 (23:22 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Apr 2023 21:22:26 +0000 (21:22 +0000)
Lib/sqlite3/__main__.py

index 9f57e7d6d58c8c5da40fd5d664471946e40415bf..3228dbc09d502a1d644b1686b95e30298d0678cf 100644 (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}