Make test_socket pass. There was an unchecked error when a Unicode

hostname was passed.
This commit is contained in:
Guido van Rossum 2007-05-18 18:55:53 +00:00
parent 1ab8330827
commit b5b2270afb
2 changed files with 24 additions and 24 deletions

View file

@ -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 {