-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
With #133883 merged, hitting ctrl+d at the start of a blank line in a multi-line entry causes the existing code to be evaluated in both the new REPL and the basic REPL:
>>> def foo(x):
...
File "<python-input-0>", line 1
def foo(x):
^
IndentationError: expected an indented block after function definition on line 1
But code.interact()
exits immediately without executing the existing code:
>>> def foo(x):
...
now exiting InteractiveConsole...
I doubt this is terribly impactful, but I think it would still be nice to have these behave the same way.
I have a patch ready that I think will resolve this, so I'll open a PR shortly.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
yihong0618
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error