Skip to content

Commit ddfc155

Browse files
authored
gh-142784: make the asyncio REPL call loop.close() at exit (#142785)
1 parent 1c544ac commit ddfc155

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎Lib/asyncio/__main__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,5 @@ def interrupt(self) -> None:
240240
break
241241

242242
console.write('exiting asyncio REPL...\n')
243+
loop.close()
243244
sys.exit(return_code)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The :mod:`asyncio` REPL now properly closes the loop upon the end of interactive session.
2+
Previously, it could cause surprising warnings.
3+
Contributed by Bartosz Sławecki.

0 commit comments

Comments
 (0)