summaryrefslogtreecommitdiffstats
path: root/Python
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 /Python
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 'Python')
-rw-r--r--Python/bltinmodule.c10
-rw-r--r--Python/import.c30
-rw-r--r--Python/sysmodule.c2
3 files changed, 21 insertions, 21 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index bfbce43..3fafa5d 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -846,7 +846,7 @@ builtin_globals(self, args)
{
PyObject *d;
- if (!PyArg_ParseTuple(args, ""))
+ if (!PyArg_ParseTuple(args, ":globals"))
return NULL;
d = PyEval_GetGlobals();
Py_INCREF(d);
@@ -1212,7 +1212,7 @@ builtin_intern(self, args)
PyObject *args;
{
PyObject *s;
- if (!PyArg_ParseTuple(args, "S", &s))
+ if (!PyArg_ParseTuple(args, "S:intern", &s))
return NULL;
Py_INCREF(s);
PyString_InternInPlace(&s);
@@ -1383,7 +1383,7 @@ builtin_locals(self, args)
{
PyObject *d;
- if (!PyArg_ParseTuple(args, ""))
+ if (!PyArg_ParseTuple(args, ":locals"))
return NULL;
d = PyEval_GetLocals();
Py_INCREF(d);
@@ -2091,7 +2091,7 @@ builtin_isinstance(self, args)
static PyObject *__class__ = NULL;
int retval = 0;
- if (!PyArg_ParseTuple(args, "OO", &inst, &cls))
+ if (!PyArg_ParseTuple(args, "OO:isinstance", &inst, &cls))
return NULL;
if (PyClass_Check(cls)) {
@@ -2150,7 +2150,7 @@ builtin_issubclass(self, args)
PyObject *cls;
int retval;
- if (!PyArg_ParseTuple(args, "OO", &derived, &cls))
+ if (!PyArg_ParseTuple(args, "OO:issubclass", &derived, &cls))
return NULL;
if (!PyClass_Check(derived) || !PyClass_Check(cls)) {
diff --git a/Python/import.c b/Python/import.c
index bce1b57..88908a9 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1951,7 +1951,7 @@ imp_get_magic(self, args)
{
char buf[4];
- if (!PyArg_ParseTuple(args, ""))
+ if (!PyArg_ParseTuple(args, ":get_magic"))
return NULL;
buf[0] = (char) ((MAGIC >> 0) & 0xff);
buf[1] = (char) ((MAGIC >> 8) & 0xff);
@@ -1969,7 +1969,7 @@ imp_get_suffixes(self, args)
PyObject *list;
struct filedescr *fdp;
- if (!PyArg_ParseTuple(args, ""))
+ if (!PyArg_ParseTuple(args, ":get_suffixes"))
return NULL;
list = PyList_New(0);
if (list == NULL)
@@ -2032,7 +2032,7 @@ imp_find_module(self, args)
{
char *name;
PyObject *path = NULL;
- if (!PyArg_ParseTuple(args, "s|O", &name, &path))
+ if (!PyArg_ParseTuple(args, "s|O:find_module", &name, &path))
return NULL;
return call_find_module(name, path);
}
@@ -2045,7 +2045,7 @@ imp_init_builtin(self, args)
char *name;
int ret;
PyObject *m;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:init_builtin", &name))
return NULL;
ret = init_builtin(name);
if (ret < 0)
@@ -2067,7 +2067,7 @@ imp_init_frozen(self, args)
char *name;
int ret;
PyObject *m;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:init_frozen", &name))
return NULL;
ret = PyImport_ImportFrozenModule(name);
if (ret < 0)
@@ -2088,7 +2088,7 @@ imp_get_frozen_object(self, args)
{
char *name;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:get_frozen_object", &name))
return NULL;
return get_frozen_object(name);
}
@@ -2099,7 +2099,7 @@ imp_is_builtin(self, args)
PyObject *args;
{
char *name;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:is_builtin", &name))
return NULL;
return PyInt_FromLong(is_builtin(name));
}
@@ -2111,7 +2111,7 @@ imp_is_frozen(self, args)
{
char *name;
struct _frozen *p;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:is_frozen", &name))
return NULL;
p = find_frozen(name);
return PyInt_FromLong((long) (p == NULL ? 0 : p->size));
@@ -2148,7 +2148,7 @@ imp_load_compiled(self, args)
PyObject *fob = NULL;
PyObject *m;
FILE *fp;
- if (!PyArg_ParseTuple(args, "ss|O!", &name, &pathname,
+ if (!PyArg_ParseTuple(args, "ss|O!:load_compiled", &name, &pathname,
&PyFile_Type, &fob))
return NULL;
fp = get_file(pathname, fob, "rb");
@@ -2172,7 +2172,7 @@ imp_load_dynamic(self, args)
PyObject *fob = NULL;
PyObject *m;
FILE *fp = NULL;
- if (!PyArg_ParseTuple(args, "ss|O!", &name, &pathname,
+ if (!PyArg_ParseTuple(args, "ss|O!:load_dynamic", &name, &pathname,
&PyFile_Type, &fob))
return NULL;
if (fob) {
@@ -2196,7 +2196,7 @@ imp_load_source(self, args)
PyObject *fob = NULL;
PyObject *m;
FILE *fp;
- if (!PyArg_ParseTuple(args, "ss|O!", &name, &pathname,
+ if (!PyArg_ParseTuple(args, "ss|O!:load_source", &name, &pathname,
&PyFile_Type, &fob))
return NULL;
fp = get_file(pathname, fob, "r");
@@ -2218,7 +2218,7 @@ imp_load_resource(self, args)
char *pathname;
PyObject *m;
- if (!PyArg_ParseTuple(args, "ss", &name, &pathname))
+ if (!PyArg_ParseTuple(args, "ss:load_resource", &name, &pathname))
return NULL;
m = PyMac_LoadResourceModule(name, pathname);
return m;
@@ -2238,7 +2238,7 @@ imp_load_module(self, args)
int type;
FILE *fp;
- if (!PyArg_ParseTuple(args, "sOs(ssi)",
+ if (!PyArg_ParseTuple(args, "sOs(ssi):load_module",
&name, &fob, &pathname,
&suffix, &mode, &type))
return NULL;
@@ -2269,7 +2269,7 @@ imp_load_package(self, args)
{
char *name;
char *pathname;
- if (!PyArg_ParseTuple(args, "ss", &name, &pathname))
+ if (!PyArg_ParseTuple(args, "ss:load_package", &name, &pathname))
return NULL;
return load_package(name, pathname);
}
@@ -2280,7 +2280,7 @@ imp_new_module(self, args)
PyObject *args;
{
char *name;
- if (!PyArg_ParseTuple(args, "s", &name))
+ if (!PyArg_ParseTuple(args, "s:new_module", &name))
return NULL;
return PyModule_New(name);
}
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index a7a5933..59a34de 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -192,7 +192,7 @@ sys_setcheckinterval(self, args)
PyObject *args;
{
PyThreadState *tstate = PyThreadState_Get();
- if (!PyArg_ParseTuple(args, "i", &tstate->interp->checkinterval))
+ if (!PyArg_ParseTuple(args, "i:setcheckinterval", &tstate->interp->checkinterval))
return NULL;
Py_INCREF(Py_None);
return Py_None;