comparison Python/sysmodule.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 b534b56379cb
children 81380082d216
comparison
equal deleted inserted replaced
72829:a52b5be3676a 72835:5e33219492bc
97 if (encoded == NULL) 97 if (encoded == NULL)
98 goto error; 98 goto error;
99 99
100 buffer = PyObject_GetAttrString(outf, "buffer"); 100 buffer = PyObject_GetAttrString(outf, "buffer");
101 if (buffer) { 101 if (buffer) {
102 result = PyObject_CallMethod(buffer, "write", "(O)", encoded); 102 _Py_identifier(write);
103 result = _PyObject_CallMethodId(buffer, &PyId_write, "(O)", encoded);
103 Py_DECREF(buffer); 104 Py_DECREF(buffer);
104 Py_DECREF(encoded); 105 Py_DECREF(encoded);
105 if (result == NULL) 106 if (result == NULL)
106 goto error; 107 goto error;
107 Py_DECREF(result); 108 Py_DECREF(result);