Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py_NoSiteFlag is deprecated for site_import #3286

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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;

Check warning on line 205 in src/nrnpython/nrnpython.cpp

View check run for this annotation

Codecov / codecov/patch

src/nrnpython/nrnpython.cpp#L205

Added line #L205 was not covered by tests
}
auto const check = [](const char* desc, PyStatus status) {
if (PyStatus_Exception(status)) {
std::ostringstream oss;
Expand Down
Loading