diff options
author | Guido van Rossum <guido@python.org> | 2007-05-18 18:55:53 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-18 18:55:53 +0000 |
commit | ca4439d388a3a53e23b2ea977e383471c8b7e5c2 (patch) | |
tree | 8daf1dc5cc03d1b6d2833af9ff3e4207e8deaa07 /Modules/socketmodule.c | |
parent | 6d719b850b7360f9ba5476e4467e28d69f90cf38 (diff) | |
download | cpython-ca4439d388a3a53e23b2ea977e383471c8b7e5c2.tar.gz |
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 4e62316d5f..71eafe60fd 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 { |