diff options
author | Guido van Rossum <guido@python.org> | 2007-05-18 18:55:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-18 18:55:53 (GMT) |
commit | b5b2270afbb1d8e0abc34e70230ca838a2d23548 (patch) | |
tree | c1dd1ae9f69646d2b123eb9d246128877e9895bf /Modules/socketmodule.c | |
parent | 1ab833082738ced53318aca05901e596d5ede683 (diff) | |
download | cpython-b5b2270afbb1d8e0abc34e70230ca838a2d23548.zip cpython-b5b2270afbb1d8e0abc34e70230ca838a2d23548.tar.gz cpython-b5b2270afbb1d8e0abc34e70230ca838a2d23548.tar.bz2 |
Make test_socket pass. There was an unchecked error when a Unicode
hostname was passed.
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 { |