diff options
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index e64c960..6d0a44c 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4821,7 +4821,9 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs) if (hobj == Py_None) { hptr = NULL; } else if (PyUnicode_Check(hobj)) { - idna = PyObject_CallMethod(hobj, "encode", "s", "idna"); + _Py_identifier(encode); + + idna = _PyObject_CallMethodId(hobj, &PyId_encode, "s", "idna"); if (!idna) return NULL; assert(PyBytes_Check(idna)); |