]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)
authorKyle Stanley <aeros167@gmail.com>
Thu, 2 Apr 2020 02:46:44 +0000 (22:46 -0400)
committerGitHub <noreply@github.com>
Thu, 2 Apr 2020 02:46:44 +0000 (04:46 +0200)
Call explicitly self.loop.shutdown_default_executor().

Lib/test/test_asyncio/test_events.py

index 4bdf82ef175a0d8ba0cf88f6d39457aadfa083ff..1f71c1f0979e06c42a2ac1423389b8fcd8b74b89 100644 (file)
@@ -365,6 +365,8 @@ class EventLoopTestsMixin:
 
         f2 = self.loop.run_in_executor(None, run)
         f2.cancel()
+        self.loop.run_until_complete(
+                self.loop.shutdown_default_executor())
         self.loop.close()
         self.loop.call_soon = patched_call_soon
         self.loop.call_soon_threadsafe = patched_call_soon