bpo-32296: Unbreak tests on Windows (#4850)
This commit is contained in:
parent
11a247df88
commit
bfbf04ef18
|
@ -2735,13 +2735,16 @@ class GetEventLoopTestsMixin:
|
||||||
self.loop = asyncio.new_event_loop()
|
self.loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(self.loop)
|
asyncio.set_event_loop(self.loop)
|
||||||
|
|
||||||
watcher = asyncio.SafeChildWatcher()
|
if sys.platform != 'win32':
|
||||||
watcher.attach_loop(self.loop)
|
watcher = asyncio.SafeChildWatcher()
|
||||||
asyncio.set_child_watcher(watcher)
|
watcher.attach_loop(self.loop)
|
||||||
|
asyncio.set_child_watcher(watcher)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
asyncio.set_child_watcher(None)
|
if sys.platform != 'win32':
|
||||||
|
asyncio.set_child_watcher(None)
|
||||||
|
|
||||||
super().tearDown()
|
super().tearDown()
|
||||||
finally:
|
finally:
|
||||||
self.loop.close()
|
self.loop.close()
|
||||||
|
|
Loading…
Reference in New Issue