File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed 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(
164
164
# getaddrinfo and friends
165
165
################################################################
166
166
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 )
168
171
169
172
170
173
# 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