[pypy-commit] pypy default: this workaround only necessary when using AI_NUMERICSERV

bdkearns noreply at buildbot.pypy.org
Mon Apr 28 18:59:36 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r71044:877e67830b30
Date: 2014-04-28 12:53 -0400
http://bitbucket.org/pypy/pypy/changeset/877e67830b30/

Log:	this workaround only necessary when using AI_NUMERICSERV

diff --git a/rpython/rlib/rsocket.py b/rpython/rlib/rsocket.py
--- a/rpython/rlib/rsocket.py
+++ b/rpython/rlib/rsocket.py
@@ -1146,9 +1146,9 @@
                 address_to_fill=None):
     # port_or_service is a string, not an int (but try str(port_number)).
     assert port_or_service is None or isinstance(port_or_service, str)
-    if _c._MACOSX:
-        if port_or_service is None or port_or_service == '0':
-            port_or_service = '00'
+    if _c._MACOSX and flags & AI_NUMERICSERV and \
+            (port_or_service is None or port_or_service == '0'):
+        port_or_service = '00'
     hints = lltype.malloc(_c.addrinfo, flavor='raw', zero=True)
     rffi.setintfield(hints, 'c_ai_family',   family)
     rffi.setintfield(hints, 'c_ai_socktype', socktype)


More information about the pypy-commit mailing list