summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-01-10 02:28:57 +0200
committerGitHub <noreply@github.com>2020-01-10 02:28:57 +0200
commit0aa8370c68f037659327bb97aad1ee5548b0f6ca (patch)
tree8ca4b38072be9f305a78d78e5fa5f35f032f75bf /numpy
parent8de9a7f786ed142cadfd52844fb34d262d7637a2 (diff)
parent3142f0fb84f4fb750256bccb1ea1434180e32d4b (diff)
downloadnumpy-0aa8370c68f037659327bb97aad1ee5548b0f6ca.tar.gz
Merge pull request #15304 from sethtroisi/remove_NPY_PY3K
MAINT: Remove NPY_PY3K constant
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/setup.py4
-rw-r--r--numpy/core/src/multiarray/descriptor.c13
2 files changed, 0 insertions, 17 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 0d383b251..e376d5a23 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -467,10 +467,6 @@ def configuration(parent_package='',top_path=None):
moredefs.append('NPY_DO_NOT_OPTIMIZE_LONGLONG_right_shift')
moredefs.append('NPY_DO_NOT_OPTIMIZE_ULONGLONG_right_shift')
- # Py3K check
- if sys.version_info[0] >= 3:
- moredefs.append(('NPY_PY3K', 1))
-
# Generate the config.h file from moredefs
with open(target, 'w') as target_f:
for d in moredefs:
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index a76b6c1e7..b89350005 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -1314,18 +1314,9 @@ _convert_from_type(PyObject *obj) {
if (PyType_IsSubtype(typ, &PyGenericArrType_Type)) {
return PyArray_DescrFromTypeObject(obj);
}
-#if !defined(NPY_PY3K)
- else if (typ == &PyInt_Type) {
- return PyArray_DescrFromType(NPY_LONG);
- }
- else if (typ == &PyLong_Type) {
- return PyArray_DescrFromType(NPY_LONGLONG);
- }
-#else
else if (typ == &PyLong_Type) {
return PyArray_DescrFromType(NPY_LONG);
}
-#endif
else if (typ == &PyFloat_Type) {
return PyArray_DescrFromType(NPY_DOUBLE);
}
@@ -1341,11 +1332,7 @@ _convert_from_type(PyObject *obj) {
else if (typ == &PyUnicode_Type) {
return PyArray_DescrFromType(NPY_UNICODE);
}
-#if defined(NPY_PY3K)
else if (typ == &PyMemoryView_Type) {
-#else
- else if (typ == &PyBuffer_Type) {
-#endif
return PyArray_DescrFromType(NPY_VOID);
}
else {