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 bef63d2 commit 92f629bCopy full SHA for 92f629b
Lib/asyncio/__main__.py
@@ -187,8 +187,8 @@ def interrupt(self) -> None:
187
from _pyrepl.main import CAN_USE_PYREPL
188
189
return_code = 0
190
- loop = asyncio.new_event_loop()
191
- asyncio.set_event_loop(loop)
+ runner = asyncio.Runner()
+ loop = runner.get_loop()
192
193
repl_locals = {'asyncio': asyncio}
194
for key in {'__name__', '__package__',
@@ -240,4 +240,5 @@ def interrupt(self) -> None:
240
break
241
242
console.write('exiting asyncio REPL...\n')
243
+ runner.close()
244
sys.exit(return_code)
0 commit comments