Migrating code to eliminate references to numpy/core/include/numpy/npy_3kcompat.h (?)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Migrating code to eliminate references to numpy/core/include/numpy/npy_3kcompat.h (?)

Otto Hirr
Greetings,

tl;dr:
Need to remove npy_3kcompat.h from any source code location since
Python2 is no longer supported.

Background:
Ran into an error after compiling various apps regarding
npy_PyErr_ChainExceptionsCause() being undefined at runtime.

Poking around shows that this is related to npy_3kcompat.h, which
seems to be for Python2 compatibility.
(There is a differently named counterpart for Python3.)

This seems to be used in a couple of numpy/core/src/multiarray files.

Seems that since Python2 is no longer supported, cleaning up cruft of
P2 will improve code and should eliminate the problem I ran into, (or
else move an error report to something else...)

Is this reasonable to eliminate?

Regards,

..Otto
(Still getting my feet wet in numpy, scipy, etc.)
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Migrating code to eliminate references to numpy/core/include/numpy/npy_3kcompat.h (?)

Charles R Harris


On Fri, Aug 21, 2020 at 3:32 PM Otto Hirr <[hidden email]> wrote:
Greetings,

tl;dr:
Need to remove npy_3kcompat.h from any source code location since
Python2 is no longer supported.

Background:
Ran into an error after compiling various apps regarding
npy_PyErr_ChainExceptionsCause() being undefined at runtime.

Poking around shows that this is related to npy_3kcompat.h, which
seems to be for Python2 compatibility.
(There is a differently named counterpart for Python3.)

This seems to be used in a couple of numpy/core/src/multiarray files.

Seems that since Python2 is no longer supported, cleaning up cruft of
P2 will improve code and should eliminate the problem I ran into, (or
else move an error report to something else...)

Is this reasonable to eliminate?


The migration is already underway, but will take time. Even after NumPy is clean we will keep it because we also need to maintain compatibility across Python 3 versions and to avoid breaking downstream projects who might be using it.

Chuck

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion