aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
committerMartin v. Löwis <martin@v.loewis.de>2011-10-10 18:11:30 +0200
commit1ee1b6fe0dd7baca0da50e365929d03d42128705 (patch)
treeae048787548a8915d3e75054a950f710ed521d84 /Modules/_csv.c
parentany_find_slice() doesn't use callbacks anymore (diff)
downloadcpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.gz
cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.tar.bz2
cpython-1ee1b6fe0dd7baca0da50e365929d03d42128705.zip
Use identifier API for PyObject_GetAttrString.
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 1334633bf7e..59c74e76369 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");