]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-139845: do not print twice in default asyncio REPL (GH-139846) (#139859)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Oct 2025 16:13:11 +0000 (18:13 +0200)
committerGitHub <noreply@github.com>
Thu, 9 Oct 2025 16:13:11 +0000 (16:13 +0000)
gh-139845: do not print twice in default asyncio REPL (GH-139846)
(cherry picked from commit a310b3a99d05e107963023a5736b67afe4ae1968)

Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Lib/asyncio/__main__.py
Misc/NEWS.d/next/Library/2025-10-09-21-37-20.gh-issue-139845.dzx5UP.rst [new file with mode: 0644]

index ff3a69d1e1729715eb2e009caab59d0e2b4c1ac0..e07dd52a2a5efc133469dd6518b666715ee3dc22 100644 (file)
@@ -74,7 +74,8 @@ class AsyncIOInteractiveConsole(InteractiveColoredConsole):
             return
         except BaseException:
             if keyboard_interrupted:
-                self.write("\nKeyboardInterrupt\n")
+                if not CAN_USE_PYREPL:
+                    self.write("\nKeyboardInterrupt\n")
             else:
                 self.showtraceback()
             return self.STATEMENT_FAILED
diff --git a/Misc/NEWS.d/next/Library/2025-10-09-21-37-20.gh-issue-139845.dzx5UP.rst b/Misc/NEWS.d/next/Library/2025-10-09-21-37-20.gh-issue-139845.dzx5UP.rst
new file mode 100644 (file)
index 0000000..3cd294e
--- /dev/null
@@ -0,0 +1 @@
+Fix to not print KeyboardInterrupt twice in default asyncio REPL.