Prevent compilation from breaking with Python 2
This commit is contained in:
@ -56,6 +56,8 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
nfunc = 0;
|
nfunc = 0;
|
||||||
pfuncs = nullptr;
|
pfuncs = nullptr;
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
#ifndef Py_LIMITED_API
|
||||||
// check for PYTHONUNBUFFERED environment variable
|
// check for PYTHONUNBUFFERED environment variable
|
||||||
const char * PYTHONUNBUFFERED = getenv("PYTHONUNBUFFERED");
|
const char * PYTHONUNBUFFERED = getenv("PYTHONUNBUFFERED");
|
||||||
|
|
||||||
@ -64,6 +66,8 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
// Force the stdout and stderr streams to be unbuffered.
|
// Force the stdout and stderr streams to be unbuffered.
|
||||||
Py_UnbufferedStdioFlag = 1;
|
Py_UnbufferedStdioFlag = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// one-time initialization of Python interpreter
|
// one-time initialization of Python interpreter
|
||||||
// pyMain stores pointer to main module
|
// pyMain stores pointer to main module
|
||||||
|
|||||||
Reference in New Issue
Block a user