Skip to content

Commit d3c2b4a

Browse files
committed
windows doesn't have childwatchers so disable it
1 parent 994560c commit d3c2b4a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

uvloop/_testbase.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ def tcp_server(self, server_prog, *,
165165
max_clients=10):
166166

167167
if addr is None:
168-
if family == socket.AF_UNIX:
168+
# Winloop comment: Windows has no Unix sockets
169+
if hasattr(socket, "AF_UNIX") and family == socket.AF_UNIX:
169170
with tempfile.NamedTemporaryFile() as tmp:
170171
addr = tmp.name
171172
else:
@@ -316,13 +317,13 @@ class AIOTestCase(BaseTestCase):
316317
def setUp(self):
317318
super().setUp()
318319

319-
if sys.version_info < (3, 12):
320+
if sys.version_info < (3, 12) and sys.platform != "win32":
320321
watcher = asyncio.SafeChildWatcher()
321322
watcher.attach_loop(self.loop)
322323
asyncio.set_child_watcher(watcher)
323324

324325
def tearDown(self):
325-
if sys.version_info < (3, 12):
326+
if sys.version_info < (3, 12) and sys.platform != "win32":
326327
asyncio.set_child_watcher(None)
327328
super().tearDown()
328329

0 commit comments

Comments
 (0)