remove compatibility for compiling LAMMPS with Python 2.x and Python 3.5 and older

This commit is contained in:
Axel Kohlmeyer
2025-02-08 05:05:00 -05:00
parent 86f7f6da98
commit 599ff11eb0
10 changed files with 29 additions and 52 deletions

View File

@ -62,12 +62,12 @@ MLIAPModelPython::MLIAPModelPython(LAMMPS *lmp, char *coefffilename, bool is_chi
// Recipe from lammps/src/pair_python.cpp :
// add current directory to PYTHONPATH
PyObject *py_path = PySys_GetObject((char *) "path");
PyList_Append(py_path, PY_STRING_FROM_STRING("."));
PyList_Append(py_path, PyUnicode_FromString("."));
// if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well
const char *potentials_path = getenv("LAMMPS_POTENTIALS");
if (potentials_path != nullptr) {
PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path));
PyList_Append(py_path, PyUnicode_FromString(potentials_path));
}
PyGILState_Release(gstate);
if (coefffilename) read_coeffs(coefffilename);