diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/timemodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 1791cf4..b49bffc 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -371,6 +371,10 @@ time_ctime(self, args) return NULL; tt = (time_t)dt; p = ctime(&tt); + if (p == NULL) { + PyErr_SetString(PyExc_ValueError, "unconvertible time"); + return NULL; + } if (p[24] == '\n') p[24] = '\0'; return PyString_FromString(p); |