diff --git a/support/__EMSCRIPTEN__.patches/3.11/asyncio/wasm_events.py b/support/__EMSCRIPTEN__.patches/3.11/asyncio/wasm_events.py index 2cb215d..0035afb 100644 --- a/support/__EMSCRIPTEN__.patches/3.11/asyncio/wasm_events.py +++ b/support/__EMSCRIPTEN__.patches/3.11/asyncio/wasm_events.py @@ -1,9 +1,8 @@ -"""Selector event loop for Em with signal handling.""" +"""Selector event loop for emsdk.""" import sys __EMSCRIPTEN__ = (sys.platform=='emscripten') - import errno import os import selectors @@ -598,13 +597,15 @@ def sock_connect(self, sock, address): if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") - if not hasattr(socket, "AF_UNIX") or sock.family != socket.AF_UNIX: - resolved = base_events._ensure_resolved( - address, family=sock.family, proto=sock.proto, loop=self - ) - if not resolved.done(): - yield from resolved - _, _, _, _, address = resolved.result()[0] + # https://github.com/emscripten-core/emscripten/issues/7417 + if not __EMSCRIPTEN__: + if not hasattr(socket, "AF_UNIX") or sock.family != socket.AF_UNIX: + resolved = base_events._ensure_resolved( + address, family=sock.family, proto=sock.proto, loop=self + ) + if not resolved.done(): + yield from resolved + _, _, _, _, address = resolved.result()[0] fut = self.create_future() self._sock_connect(fut, sock, address) diff --git a/support/__EMSCRIPTEN__.patches/3.12/asyncio/wasm_events.py b/support/__EMSCRIPTEN__.patches/3.12/asyncio/wasm_events.py index 2cb215d..0035afb 100644 --- a/support/__EMSCRIPTEN__.patches/3.12/asyncio/wasm_events.py +++ b/support/__EMSCRIPTEN__.patches/3.12/asyncio/wasm_events.py @@ -1,9 +1,8 @@ -"""Selector event loop for Em with signal handling.""" +"""Selector event loop for emsdk.""" import sys __EMSCRIPTEN__ = (sys.platform=='emscripten') - import errno import os import selectors @@ -598,13 +597,15 @@ def sock_connect(self, sock, address): if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") - if not hasattr(socket, "AF_UNIX") or sock.family != socket.AF_UNIX: - resolved = base_events._ensure_resolved( - address, family=sock.family, proto=sock.proto, loop=self - ) - if not resolved.done(): - yield from resolved - _, _, _, _, address = resolved.result()[0] + # https://github.com/emscripten-core/emscripten/issues/7417 + if not __EMSCRIPTEN__: + if not hasattr(socket, "AF_UNIX") or sock.family != socket.AF_UNIX: + resolved = base_events._ensure_resolved( + address, family=sock.family, proto=sock.proto, loop=self + ) + if not resolved.done(): + yield from resolved + _, _, _, _, address = resolved.result()[0] fut = self.create_future() self._sock_connect(fut, sock, address)