Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 41770:651fa2c9c2ab
Make test_socket pass. There was an unchecked error when a Unicode
hostname was passed.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 May 2007 18:55:53 +0000 |
| parents | b29d71d43c80 |
| children | 8e062e572ea4 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Fri May 18 17:15:44 2007 +0000 +++ b/Modules/socketmodule.c Fri May 18 18:55:53 2007 +0000 @@ -3854,7 +3854,8 @@ 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 {
