BUG: Fix environment checking logic for NUMPY_WARN_IF_NO_MEM_POLICY
#20238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logic was reversed accidentally, since the default is to not warn.
I would be happy to dig a bit deeper and move the
getenv
to importtime (with an small internal helper to set it). Since the
getenv
right now will be called for quite a bit of pythran code currently.
I have a bit of a problem with these tests locally (but I am not sure it is specific to these test, had simlar problems elsehwere). Somehow the wrongnumpy
headers get picked up, even though the current include is passed... (so this is untested locally)Tested locally, the test is a bit "unreliably" because it just prints out when the error is raised, but overall that is fine. My issue with the test locally, is due to debian linking the NumPy includes to:
/usr/include/python3.9/numpy
which probably gets picked up (I guess that is wrong in debian, and I opened a bug-report there).Edit: Fixup for gh-20200