Fix bogus error reporting on strptime: let PyArg_ParseTuple set exception.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 14 Mar 2000 21:17:16 +0000 (21:17 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 14 Mar 2000 21:17:16 +0000 (21:17 +0000)
Also, wrap long line.

Modules/timemodule.c

index 392f2b9819d1d8617ee0f6ff0851b40bd6f01dc2..d5a598b6b79a314aef7d2a600e0be3964663e1f0 100644 (file)
@@ -373,7 +373,8 @@ time_strftime(self, args)
 
        memset((ANY *) &buf, '\0', sizeof(buf));
 
-       if (!PyArg_ParseTuple(args, "sO:strftime", &fmt, &tup) || !gettmarg(tup, &buf))
+       if (!PyArg_ParseTuple(args, "sO:strftime", &fmt, &tup) 
+           || !gettmarg(tup, &buf))
                return NULL;
        fmtlen = strlen(fmt);
 
@@ -421,10 +422,8 @@ time_strptime(self, args)
        char *buf;
        char *s;
 
-       if (!PyArg_ParseTuple(args, "s|s:strptime", &buf, &fmt)) {
-               PyErr_SetString(PyExc_ValueError, "invalid argument");
-               return NULL;
-       }
+       if (!PyArg_ParseTuple(args, "s|s:strptime", &buf, &fmt))
+               return NULL;
        memset((ANY *) &tm, '\0', sizeof(tm));
        s = strptime(buf, fmt, &tm);
        if (s == NULL) {