diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 44cb9c8..5ff8eb3 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -499,7 +499,9 @@ time_strftime(PyObject *self, PyObject *args) if (outbuf == NULL) { return PyErr_NoMemory(); } + Py_BEGIN_ALLOW_THREADS buflen = strftime(outbuf, i, fmt, &buf); + Py_END_ALLOW_THREADS if (buflen > 0 || i >= 256 * fmtlen) { /* If the buffer is 256 times as long as the format, it's probably not failing for lack of room!