Mercurial > cpython-lru_cache-weakref
diff Python/ast.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 | 8beaa9a37387 |
| children | 7109f31300fb |
line wrap: on
line diff
--- a/Python/ast.c Sun Oct 09 08:58:16 2011 +0200 +++ b/Python/ast.c Sun Oct 09 10:38:36 2011 +0200 @@ -527,6 +527,7 @@ static identifier new_identifier(const char* n, PyArena *arena) { + _Py_identifier(normalize); PyObject* id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); if (!id || PyUnicode_READY(id) == -1) return NULL; @@ -537,7 +538,7 @@ PyObject *id2; if (!m) return NULL; - id2 = PyObject_CallMethod(m, "normalize", "sO", "NFKC", id); + id2 = _PyObject_CallMethodId(m, &PyId_normalize, "sO", "NFKC", id); Py_DECREF(m); if (!id2) return NULL;
