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+ Fixed socket module for some older systems which lack ``socket.AI_NUMERICSERV ``.
2+ Now trio works on legacy (pre-Lion) macOS.
Original file line number Diff line number Diff line change @@ -164,7 +164,10 @@ def set_custom_socket_factory(
164164# getaddrinfo and friends
165165################################################################
166166
167- _NUMERIC_ONLY = _stdlib_socket .AI_NUMERICHOST | _stdlib_socket .AI_NUMERICSERV
167+ # AI_NUMERICSERV may be missing on some older platforms, so use it when available.
168+ # See: https://github.com/python-trio/trio/issues/3133
169+ _NUMERIC_ONLY = _stdlib_socket .AI_NUMERICHOST
170+ _NUMERIC_ONLY |= getattr (_stdlib_socket , "AI_NUMERICSERV" , 0 )
168171
169172
170173# It would be possible to @overload the return value depending on Literal[AddressFamily.INET/6], but should probably be added in typeshed first
You can’t perform that action at this time.
0 commit comments