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 c9a38cc24c..4c1d8f0034 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5989,7 +5989,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", value);
pptr = pbuf;
} else if (PyUnicode_Check(pobj)) {
- pptr = _PyUnicode_AsString(pobj);
+ pptr = PyUnicode_AsUTF8(pobj);
if (pptr == NULL)
goto err;
} else if (PyBytes_Check(pobj)) {