mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-01 11:15:57 +00:00
fixed python3 stdout/stderr line buffering
This commit is contained in:
@@ -500,7 +500,11 @@ void init_uwsgi_vars() {
|
||||
|
||||
#ifdef PYTHREE
|
||||
// fix stdout and stderr
|
||||
PyObject *new_stdprint = PyFile_NewStdPrinter(2);
|
||||
#ifdef HAS_NO_ERRORS_IN_PyFile_FromFd
|
||||
PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, 0);
|
||||
#else
|
||||
PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, NULL, 0);
|
||||
#endif
|
||||
PyDict_SetItemString(pysys_dict, "stdout", new_stdprint);
|
||||
PyDict_SetItemString(pysys_dict, "__stdout__", new_stdprint);
|
||||
PyDict_SetItemString(pysys_dict, "stderr", new_stdprint);
|
||||
|
||||
Reference in New Issue
Block a user