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

Add numpy version check #819

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Conversation

jagerman
Copy link
Member

The numpy API constants can check past the end of the API array if the numpy version is too old thus causing a segfault. The current list of functions requires numpy >= 1.7.0, so this adds a check and exception if numpy is too old.

The added feature version API element was added in numpy 1.4.0, so this could still segfault if loaded in 1.3.0 or earlier, but given that 1.4.0 was released at the end of 2009, it seems reasonable enough to not worry about that case. (1.7.0 was released in early 2013).

Fixes #818

The numpy API constants can check past the end of the API array if the
numpy version is too old thus causing a segfault.  The current list of
functions requires numpy >= 1.7.0, so this adds a check and exception if
numpy is too old.

The added feature version API element was added in numpy 1.4.0, so this
could still segfault if loaded in 1.3.0 or earlier, but given that
1.4.0 was released at the end of 2009, it seems reasonable enough to
not worry about that case.  (1.7.0 was released in early 2013).
@wjakob
Copy link
Member

wjakob commented Apr 28, 2017

Looks good!

@wjakob wjakob merged commit ce494d6 into pybind:master Apr 28, 2017
@dean0x7d dean0x7d modified the milestone: v2.2 Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants