Skip to content

Commit

Permalink
_socket.py: fix for systems where AI_NUMERICSERV is not defined
Browse files Browse the repository at this point in the history
Credits to @CoolCat467
Closes: #3133
  • Loading branch information
barracuda156 committed Nov 12, 2024
1 parent a32de81 commit b76db23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/trio/_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def set_custom_socket_factory(
# getaddrinfo and friends
################################################################

_NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST | _stdlib_socket.AI_NUMERICSERV
_NUMERIC_ONLY = _stdlib_socket.AI_NUMERICHOST
_NUMERIC_ONLY |= getattr(_stdlib_socket, "AI_NUMERICSERV", 0)


# It would be possible to @overload the return value depending on Literal[AddressFamily.INET/6], but should probably be added in typeshed first
Expand Down

0 comments on commit b76db23

Please sign in to comment.