File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Started using `MultiLoopChildWatcher` when it's available under POSIX while setting up the test I/O loop.
Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ Pawel Miech
230230Pepe Osca
231231Philipp A.
232232Pieter van Beek
233+ Qiao Han
233234Rafael Viotti
234235Raphael Bialon
235236Raúl Cumplido
Original file line number Diff line number Diff line change @@ -519,7 +519,16 @@ def setup_test_loop(
519519 asyncio .set_event_loop (loop )
520520 if sys .platform != "win32" and not skip_watcher :
521521 policy = asyncio .get_event_loop_policy ()
522- watcher = asyncio .SafeChildWatcher ()
522+ watcher : asyncio .AbstractChildWatcher
523+ try : # Python >= 3.8
524+ # Refs:
525+ # * https://github.com/pytest-dev/pytest-xdist/issues/620
526+ # * https://stackoverflow.com/a/58614689/595220
527+ # * https://bugs.python.org/issue35621
528+ # * https://github.com/python/cpython/pull/14344
529+ watcher = asyncio .MultiLoopChildWatcher ()
530+ except AttributeError : # Python < 3.8
531+ watcher = asyncio .SafeChildWatcher ()
523532 watcher .attach_loop (loop )
524533 with contextlib .suppress (NotImplementedError ):
525534 policy .set_child_watcher (watcher )
You can’t perform that action at this time.
0 commit comments