8000 Merge pull request #15304 from sethtroisi/remove_NPY_PY3K · numpy/numpy@0aa8370 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0aa8370

Browse files
authored
Merge pull request #15304 from sethtroisi/remove_NPY_PY3K
MAINT: Remove NPY_PY3K constant
2 parents 8de9a7f + 3142f0f commit 0aa8370

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

numpy/core/setup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,6 @@ def generate_config_h(ext, build_dir):
467467
moredefs.append('NPY_DO_NOT_OPTIMIZE_LONGLONG_right_shift')
468468
moredefs.append('NPY_DO_NOT_OPTIMIZE_ULONGLONG_right_shift')
469469

470-
# Py3K check
471-
if sys.version_info[0] >= 3:
472-
moredefs.append(('NPY_PY3K', 1))
473-
474470
# Generate the config.h file from moredefs
475471
with open(target, 'w') as target_f:
476472
for d in moredefs:

numpy/core/src/multiarray/descriptor.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,18 +1314,9 @@ _convert_from_type(PyObject *obj) {
13141314
if (PyType_IsSubtype(typ, &PyGenericArrType_Type)) {
13151315
return PyArray_DescrFromTypeObject(obj);
13161316
}
1317-
#if !defined(NPY_PY3K)
1318-
else if (typ == &PyInt_Type) {
1319-
return PyArray_DescrFromType(NPY_LONG);
1320-
}
1321-
else if (typ == &PyLong_Type) {
1322-
return PyArray_DescrFromType(NPY_LONGLONG);
1323-
}
1324-
#else
13251317
else if (typ == &PyLong_Type) {
13261318
return PyArray_DescrFromType(NPY_LONG);
13271319
}
1328-
#endif
13291320
else if (typ == &PyFloat_Type) {
13301321
return PyArray_DescrFromType(NPY_DOUBLE);
13311322
}
@@ -1341,11 +1332,7 @@ _convert_from_type(PyObject *obj) {
13411332
else if (typ == &PyUnicode_Type) {
13421333
return PyArray_DescrFromType(NPY_UNICODE);
13431334
}
1344-
#if defined(NPY_PY3K)
13451335
else if (typ == &PyMemoryView_Type) {
1346-
#else
1347-
else if (typ == &PyBuffer_Type) {
1348-
#endif
13491336
return PyArray_DescrFromType(NPY_VOID);
13501337
}
13511338
else {

0 commit comments

Comments
 (0)
0