Kaydet (Commit) 78535706 authored tarafından Guido van Rossum's avatar Guido van Rossum

Raise ValueError: "unconvertible time" when ctime() returns NULL,

instead of dumping core.
üst 1aca4d80
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment