summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-09 08:38:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-10-09 08:38:36 (GMT)
commitafe55bba33a20f87a58f940186359237064b428f (patch)
tree66d64a1518d79c3d0e90c0a1d0080cd88e887d99 /Modules/cjkcodecs
parent67df285a3389c7fdb8c7bd301314ac45e17f8074 (diff)
downloadcpython-afe55bba33a20f87a58f940186359237064b428f.zip
cpython-afe55bba33a20f87a58f940186359237064b428f.tar.gz
cpython-afe55bba33a20f87a58f940186359237064b428f.tar.bz2
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 1b37845..8635a56 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -1579,12 +1579,13 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
PyObject *unistr)
{
PyObject *str, *wr;
+ _Py_identifier(write);
str = encoder_encode_stateful(STATEFUL_ECTX(self), unistr, 0);
if (str == NULL)
return -1;
- wr = PyObject_CallMethod(self->stream, "write", "O", str);
+ wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", str);
Py_DECREF(str);
if (wr == NULL)
return -1;
@@ -1650,7 +1651,9 @@ mbstreamwriter_reset(MultibyteStreamWriterObject *self)
assert(PyBytes_Check(pwrt));
if (PyBytes_Size(pwrt) > 0) {
PyObject *wr;
- wr = PyObject_CallMethod(self->stream, "write", "O", pwrt);
+ _Py_identifier(write);
+
+ wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", pwrt);
if (wr == NULL) {
Py_DECREF(pwrt);
return NULL;