Skip to content

Commit d6aa7e1

Browse files
[3.13] gh-142784: make the asyncio REPL call loop.close() at exit (GH-142785) (#142932)
gh-142784: make the asyncio REPL call `loop.close()` at exit (GH-142785) (cherry picked from commit ddfc155) Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent 8f7c4f1 commit d6aa7e1

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
@@ -202,4 +202,5 @@ def interrupt(self) -> None:
202202
break
203203

204204
console.write('exiting asyncio REPL...\n')
205+
loop.close()
205206
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)