Skip to content

Commit cfd5a68

Browse files
deepwzhadqm
andcommitted
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 4a51771 commit cfd5a68

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
@@ -428,7 +428,7 @@ def do(self) -> None:
428428
r.update_screen()
429429
r.console.finish()
430430
raise EOFError
431-
elif "\n" in b and self.event[-1] == "\004":
431+
elif b and b[-1].endswith('\n') and self.event[-1] == "\004":
432432
self.finish = True
433433

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

0 commit comments

Comments
 (0)