diff options
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 4e62316..71eafe6 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -3854,7 +3854,8 @@ socket_getaddrinfo(PyObject *self, PyObject *args) idna = PyObject_CallMethod(hobj, "encode", "s", "idna"); if (!idna) return NULL; - hptr = PyString_AsString(idna); + assert(PyBytes_Check(idna)); + hptr = PyBytes_AsString(idna); } else if (PyString_Check(hobj)) { hptr = PyString_AsString(hobj); } else { |