Unverified Kaydet (Commit) bfbf04ef authored tarafından Yury Selivanov's avatar Yury Selivanov Kaydeden (comit) GitHub

bpo-32296: Unbreak tests on Windows (#4850)

üst 11a247df
...@@ -2735,13 +2735,16 @@ class GetEventLoopTestsMixin: ...@@ -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)
if sys.platform != 'win32':
watcher = asyncio.SafeChildWatcher() watcher = asyncio.SafeChildWatcher()
watcher.attach_loop(self.loop) watcher.attach_loop(self.loop)
asyncio.set_child_watcher(watcher) asyncio.set_child_watcher(watcher)
def tearDown(self): def tearDown(self):
try: try:
if sys.platform != 'win32':
asyncio.set_child_watcher(None) asyncio.set_child_watcher(None)
super().tearDown() super().tearDown()
finally: finally:
self.loop.close() self.loop.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment