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

BUG: Fix test_ctypeslib and test_indexing for debug interpreter #7565

Merged
merged 1 commit into from
May 9, 2016

Conversation

tadeu
Copy link

@tadeu tadeu commented Apr 20, 2016

…preter

See #7563

@charris charris changed the title TST: Fix test_ctypeslib and test_indexing when running on debug inter… BUG: Fix test_ctypeslib and test_indexing for debug interpreter May 5, 2016
if hasattr(sys, 'gettotalrefcount'):
try:
cdll = load_library('multiarray_d', np.core.multiarray.__file__)
except OSError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the fix should be in load_library, which already tries two variant file name extensions from get_shared_lib_extension. Remind me of where exactly the _d comes from?

@tadeu
Copy link
Author

tadeu commented May 6, 2016

The _d suffix is expected for pyd files when using the debug version of python (python_d.exe).

There was a previous PR doing the change in load_library (PR #7563), but it was rejected, and in the discussion it was decided that the fix should be in the client side:

Yes, afaics the _d suffix needs to be added on the user side, not in load_library. (@pv)

#7563 (comment)

I think it is safer to fix in the test too, since load_library is generic for any dll, and not specific to pyd files.

@@ -15,7 +15,14 @@


try:
cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.__file__)
cdll = None
if hasattr(sys, 'gettotalrefcount'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note that this is a check for running in a debug version of Python would be helpful.

@charris charris merged commit 49d1298 into numpy:master May 9, 2016
@charris
Copy link
Member

charris commented May 9, 2016

Thanks @tadeu .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants