Skip to content

Commit

Permalink
Py_NoSiteFlag is deprecated for site_import (#3286)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu authored Dec 12, 2024
1 parent 5979c8b commit 3fb7b21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nrnpython/nrnpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ static int nrnpython_start(int b) {
static int started = 0;
if (b == 1 && !started) {
p_nrnpy_pyrun = nrnpy_pyrun;
if (nrnpy_nositeflag) {
Py_NoSiteFlag = 1;
}
// Create a Python configuration, see
// https://docs.python.org/3.8/c-api/init_config.html#python-configuration, so that
// {nrniv,special} -python behaves as similarly as possible to python. In particular this
// affects locale coercion. Under some circumstances Python does not straightforwardly
// handle settings like LC_ALL=C, so using a different configuration can lead to surprising
// differences.
PythonConfigWrapper config;
if (nrnpy_nositeflag) {
config->site_import = 0;
}
auto const check = [](const char* desc, PyStatus status) {
if (PyStatus_Exception(status)) {
std::ostringstream oss;
Expand Down

0 comments on commit 3fb7b21

Please sign in to comment.