diff --git a/Lib/asyncio/__main__.py b/Lib/asyncio/__main__.py index d078ebfa4cedbe..43ba1c3b556652 100644 --- a/Lib/asyncio/__main__.py +++ b/Lib/asyncio/__main__.py @@ -191,9 +191,9 @@ def interrupt(self) -> None: asyncio.set_event_loop(loop) repl_locals = {'asyncio': asyncio} - for key in {'__name__', '__package__', - '__loader__', '__spec__', - '__builtins__', '__file__'}: + for key in {'__name__', + '__loader__', + '__builtins__'}: repl_locals[key] = locals()[key] console = AsyncIOInteractiveConsole(repl_locals, loop) diff --git a/Misc/NEWS.d/next/Library/2025-10-19-17-34-07.gh-issue-140326.kZM0pV.rst b/Misc/NEWS.d/next/Library/2025-10-19-17-34-07.gh-issue-140326.kZM0pV.rst new file mode 100644 index 00000000000000..aec5ad27a47cd2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-10-19-17-34-07.gh-issue-140326.kZM0pV.rst @@ -0,0 +1 @@ +Disable relative import in asyncio repl