diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-10-10 16:11:30 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-10-10 16:11:30 (GMT) |
commit | 1ee1b6fe0dd7baca0da50e365929d03d42128705 (patch) | |
tree | ae048787548a8915d3e75054a950f710ed521d84 /Modules/_csv.c | |
parent | 794d567b173e4cc10ad233aeb8743283ea9c3e6b (diff) | |
download | cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.zip cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.gz cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.bz2 |
Use identifier API for PyObject_GetAttrString.
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r-- | Modules/_csv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index 1334633..59c74e7 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -1317,6 +1317,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args) { PyObject * output_file, * dialect = NULL; WriterObj * self = PyObject_GC_New(WriterObj, &Writer_Type); + _Py_identifier(write); if (!self) return NULL; @@ -1333,7 +1334,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args) Py_DECREF(self); return NULL; } - self->writeline = PyObject_GetAttrString(output_file, "write"); + self->writeline = _PyObject_GetAttrId(output_file, &PyId_write); if (self->writeline == NULL || !PyCallable_Check(self->writeline)) { PyErr_SetString(PyExc_TypeError, "argument 1 must have a \"write\" method"); |