deploy-stub: Fix immediate exit on Windows if no log_filename is set

This commit is contained in:
rdb 2020-12-28 15:27:56 +01:00
parent 21aa31f8c0
commit f2e66a280c

View File

@ -360,15 +360,20 @@ static int enable_line_buffering(PyObject *file) {
if (method != NULL) {
PyObject *result = PyObject_Call(method, args, kwargs);
Py_DECREF(method);
Py_DECREF(kwargs);
Py_DECREF(args);
if (result != NULL) {
Py_DECREF(result);
} else {
PyErr_Clear();
return 0;
}
} else {
Py_DECREF(kwargs);
Py_DECREF(args);
PyErr_Clear();
return 0;
}
Py_DECREF(kwargs);
Py_DECREF(args);
#else
/* Older versions just don't expose a way to reconfigure(), but it's still
safe to override the property; we just have to use a hack to do it,