Skip to content

Commit

Permalink
Fix the warning from setting Py_UnbufferedStdioFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Jun 21, 2024
1 parent f4a88d2 commit 0a44672
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/pythonShim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ void loadCanteraPython()
// Prevent output buffering managed by Python.
// @todo: It may be better to avoid replacing the existing Logger instance
// with a PythonLogger in the case of an embedded Python interpreter.
Py_UnbufferedStdioFlag = 1;
const char* venv_path = getenv("VIRTUAL_ENV");
if (venv_path != nullptr) {
PyConfig pyconf;
pyconf.buffered_stdio = 0;
PyConfig_InitPythonConfig(&pyconf);

#ifdef _WIN32
Expand All @@ -90,7 +90,7 @@ void loadCanteraPython()
} else {
#ifdef _WIN32
setPythonHome();
#endif
#endif
Py_Initialize();
}
PyObject* pythonExt = PyImport_ImportModule("cantera");
Expand Down

0 comments on commit 0a44672

Please sign in to comment.