Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 72835:5e33219492bc
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sun, 09 Oct 2011 10:38:36 +0200 |
| parents | d4ce850b06b7 |
| children | 41a1de81ef2b |
line wrap: on
line diff
--- a/Modules/socketmodule.c Sun Oct 09 08:58:16 2011 +0200 +++ b/Modules/socketmodule.c Sun Oct 09 10:38:36 2011 +0200 @@ -4821,7 +4821,9 @@ if (hobj == Py_None) { hptr = NULL; } else if (PyUnicode_Check(hobj)) { - idna = PyObject_CallMethod(hobj, "encode", "s", "idna"); + _Py_identifier(encode); + + idna = _PyObject_CallMethodId(hobj, &PyId_encode, "s", "idna"); if (!idna) return NULL; assert(PyBytes_Check(idna));
