We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
asyncio.Runner
1 parent 393aaad commit 875fd2aCopy full SHA for 875fd2a
Lib/asyncio/__main__.py
@@ -192,8 +192,8 @@ def interrupt(self) -> None:
192
from _pyrepl.main import CAN_USE_PYREPL
193
194
return_code = 0
195
- loop = asyncio.new_event_loop()
196
- asyncio.set_event_loop(loop)
+ runner = asyncio.Runner()
+ loop = runner.get_loop()
197
198
repl_locals = {'asyncio': asyncio}
199
for key in {'__name__', '__package__',
@@ -245,4 +245,5 @@ def interrupt(self) -> None:
245
break
246
247
console.write('exiting asyncio REPL...\n')
248
+ runner.close()
249
sys.exit(return_code)
0 commit comments