summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index b9579283f8..9b58a11bd5 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5041,7 +5041,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
PyErr_SetString(PyExc_OSError, "Int or String expected");
goto err;
}
-#ifdef __APPLE__
+#if defined(__APPLE__) && defined(AI_NUMERICSERV)
if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {
/* On OSX upto at least OSX 10.8 getaddrinfo crashes
* if AI_NUMERICSERV is set and the servname is NULL or "0".