Oops, big glitch. Charles had put a 1 in the column for argument list

type for all functions.  However many function call PyArg_Parse() and
need a 0.  This is so that when they didn't change anything, the can
do Py_INCREF(args); return args.  Reverted this back.  For atof(),
there's no reason not to use PyArg_ParseTuple(), so I changed the code
(atoi and atol already used that).
This commit is contained in:
Guido van Rossum 1997-12-30 05:44:10 +00:00
parent 786205e385
commit 74608f8b8a
1 changed files with 8 additions and 8 deletions

View File

@ -784,7 +784,7 @@ strop_atof(self, args)
double x;
char buffer[256]; /* For errors */
if (!PyArg_Parse(args, "s", &s))
if (!PyArg_ParseTuple(args, "s", &s))
return NULL;
while (*s && isspace(Py_CHARMASK(*s)))
s++;
@ -1114,22 +1114,22 @@ strop_methods[] = {
{"atof", strop_atof, 1, atof__doc__},
{"atoi", strop_atoi, 1, atoi__doc__},
{"atol", strop_atol, 1, atol__doc__},
{"capitalize", strop_capitalize, 1, capitalize__doc__},
{"capitalize", strop_capitalize, 0, capitalize__doc__},
{"find", strop_find, 1, find__doc__},
{"join", strop_joinfields, 1, joinfields__doc__},
{"joinfields", strop_joinfields, 1, joinfields__doc__},
{"lstrip", strop_lstrip, 1, lstrip__doc__},
{"lower", strop_lower, 1, lower__doc__},
{"lstrip", strop_lstrip, 0, lstrip__doc__},
{"lower", strop_lower, 0, lower__doc__},
{"maketrans", strop_maketrans, 1, maketrans__doc__},
{"replace", strop_replace, 1, replace__doc__},
{"rfind", strop_rfind, 1, rfind__doc__},
{"rstrip", strop_rstrip, 1,rstrip__doc__},
{"rstrip", strop_rstrip, 0, rstrip__doc__},
{"split", strop_splitfields, 1, splitfields__doc__},
{"splitfields", strop_splitfields, 1, splitfields__doc__},
{"strip", strop_strip, 1, strip__doc__},
{"swapcase", strop_swapcase, 1, swapcase__doc__},
{"strip", strop_strip, 0, strip__doc__},
{"swapcase", strop_swapcase, 0, swapcase__doc__},
{"translate", strop_translate, 1, translate__doc__},
{"upper", strop_upper, 1, upper__doc__},
{"upper", strop_upper, 0, upper__doc__},
{NULL, NULL} /* sentinel */
};