summaryrefslogtreecommitdiffstats
path: root/Modules/newmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-02-29 13:59:29 (GMT)
committerGuido van Rossum <guido@python.org>2000-02-29 13:59:29 (GMT)
commit43713e5a2899930a8698e244b0d0fef59a676d17 (patch)
tree3d9740aff47f70cea403a2c924a37b468d1eded6 /Modules/newmodule.c
parenta9b2b4be26df7c3da8a20d1a5f4d2b796e455b4b (diff)
downloadcpython-43713e5a2899930a8698e244b0d0fef59a676d17.zip
cpython-43713e5a2899930a8698e244b0d0fef59a676d17.tar.gz
cpython-43713e5a2899930a8698e244b0d0fef59a676d17.tar.bz2
Massive patch by Skip Montanaro to add ":name" to as many
PyArg_ParseTuple() format string arguments as possible.
Diffstat (limited to 'Modules/newmodule.c')
-rw-r--r--Modules/newmodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/newmodule.c b/Modules/newmodule.c
index 786ddc5..2758f14 100644
--- a/Modules/newmodule.c
+++ b/Modules/newmodule.c
@@ -45,7 +45,7 @@ new_instance(unused, args)
PyObject* klass;
PyObject *dict;
PyInstanceObject *inst;
- if (!PyArg_ParseTuple(args, "O!O!",
+ if (!PyArg_ParseTuple(args, "O!O!:instance",
&PyClass_Type, &klass,
&PyDict_Type, &dict))
return NULL;
@@ -71,7 +71,7 @@ new_instancemethod(unused, args)
PyObject* self;
PyObject* classObj;
- if (!PyArg_ParseTuple(args, "OOO!",
+ if (!PyArg_ParseTuple(args, "OOO!:instancemethod",
&func,
&self,
&PyClass_Type, &classObj))
@@ -105,7 +105,7 @@ new_function(unused, args)
PyObject* defaults = Py_None;
PyFunctionObject* newfunc;
- if (!PyArg_ParseTuple(args, "O!O!|SO!",
+ if (!PyArg_ParseTuple(args, "O!O!|SO!:function",
&PyCode_Type, &code,
&PyDict_Type, &globals,
&name,
@@ -152,7 +152,7 @@ new_code(unused, args)
PyObject* lnotab;
PyBufferProcs *pb;
- if (!PyArg_ParseTuple(args, "iiiiOO!O!O!SSiS",
+ if (!PyArg_ParseTuple(args, "iiiiOO!O!O!SSiS:code",
&argcount, &nlocals, &stacksize, &flags,
&code,
&PyTuple_Type, &consts,
@@ -188,7 +188,7 @@ new_module(unused, args)
{
char *name;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:module", &name))
return NULL;
return PyModule_New(name);
}
@@ -205,7 +205,7 @@ new_class(unused, args)
PyObject * classes;
PyObject * dict;
- if (!PyArg_ParseTuple(args, "SO!O!", &name, &PyTuple_Type, &classes,
+ if (!PyArg_ParseTuple(args, "SO!O!:class", &name, &PyTuple_Type, &classes,
&PyDict_Type, &dict))
return NULL;
return PyClass_New(classes, dict, name);