Skip to content

Commit 92bb608

Browse files
deepwzhadqm
andauthored
Fix the logic of Ctrl+D (^ D) behavior in the mod: _pyrepl module to ensure correct termination of input under specific conditions.
Co-authored-by: adam j hartz <adam@smatz.net>
1 parent b0c288a commit 92bb608

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyrepl/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def do(self) -> None:
421421
r.update_screen()
422422
r.console.finish()
423423
raise EOFError
424-
elif "\n" in b and self.event[-1] == "\004":
424+
elif b and b[-1].endswith('\n') and self.event[-1] == "\004":
425425
self.finish = True
426426

427427
for i in range(r.get_arg()):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy