8000 Register loop shutdown on atexit · python-docs-tr/cpython@18a5acb · GitHub
[go: up one dir, main page]

Skip to content

Commit 18a5acb

Browse files
committed
Register loop shutdown on atexit
1 parent 09b4161 commit 18a5acb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/unittest/async_case.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import atexit
23
import inspect
34
import warnings
45

@@ -240,6 +241,7 @@ def setUpAsyncioLoop(self):
240241
if loop is not None:
241242
loop = self.setUpGlobalAsyncioLoop()
242243
self.__class__._globalAsyncioLoop = loop
244+
atexit.register(self.tearDownGlobalAsyncioLoop, loop)
243245
return loop
244246

245247
def tearDownAsyncioLoop(self, loop):

0 commit comments

Comments
 (0)
0