summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-06-20 04:23:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-06-20 04:23:19 (GMT)
commit1761a7cc8b3fffb7c04d81609c705f353eef14a7 (patch)
treef6d9ac6c2c098f699a3da77072af790b04a93a67 /Modules
parent1b6f7a9057874ecd2793059f210de87837fe1911 (diff)
downloadcpython-1761a7cc8b3fffb7c04d81609c705f353eef14a7.zip
cpython-1761a7cc8b3fffb7c04d81609c705f353eef14a7.tar.gz
cpython-1761a7cc8b3fffb7c04d81609c705f353eef14a7.tar.bz2
Use PyArg_UnpackTuple() where possible.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_csv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 077416c..7721c40 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -300,7 +300,7 @@ dialect_init(DialectObj * self, PyObject * args, PyObject * kwargs)
self->doublequote = 1;
self->strict = 0;
- if (!PyArg_ParseTuple(args, "|O", &dialect))
+ if (!PyArg_UnpackTuple(args, "", 0, 1, &dialect))
return -1;
Py_XINCREF(dialect);
if (kwargs != NULL) {
@@ -842,7 +842,7 @@ csv_reader(PyObject *module, PyObject *args, PyObject *keyword_args)
self->field_len = 0;
self->state = START_RECORD;
- if (!PyArg_ParseTuple(args, "O|O", &iterator, &dialect)) {
+ if (!PyArg_UnpackTuple(args, "", 1, 2, &iterator, &dialect)) {
Py_DECREF(self);
return NULL;
}
@@ -1287,7 +1287,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
self->rec_len = 0;
self->num_fields = 0;
- if (!PyArg_ParseTuple(args, "O|O", &output_file, &dialect)) {
+ if (!PyArg_UnpackTuple(args, "", 1, 2, &output_file, &dialect)) {
Py_DECREF(self);
return NULL;
}
@@ -1327,7 +1327,7 @@ csv_register_dialect(PyObject *module, PyObject *args)
{
PyObject *name_obj, *dialect_obj;
- if (!PyArg_ParseTuple(args, "OO", &name_obj, &dialect_obj))
+ if (!PyArg_UnpackTuple(args, "", 2, 2, &name_obj, &dialect_obj))
return NULL;
if (!PyString_Check(name_obj)
#ifdef Py_USING_UNICODE