summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJay Bourque <jay.bourque@continuum.io>2013-04-03 15:53:53 -0500
committerJay Bourque <jay.bourque@continuum.io>2013-04-26 12:44:31 -0500
commit55d55ec93093d703261b64ebb47980446dc89251 (patch)
tree2ffa40e2acd8bf2665e289783ce488938d4341bb /numpy
parentaa0b3cb3c61ff27fa004a2e65ae8ad51dc6e645a (diff)
downloadnumpy-55d55ec93093d703261b64ebb47980446dc89251.tar.gz
Fix build issues on python 3
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/umath/rational.c.src7
1 files changed, 6 insertions, 1 deletions
diff --git a/numpy/core/src/umath/rational.c.src b/numpy/core/src/umath/rational.c.src
index 26a9c65c3..cd6f773c9 100644
--- a/numpy/core/src/umath/rational.c.src
+++ b/numpy/core/src/umath/rational.c.src
@@ -657,7 +657,11 @@ static PyTypeObject PyRational_Type = {
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
+#if PY_MAJOR_VERSION >= 3
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+#else
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES, /* tp_flags */
+#endif
"Fixed precision rational numbers", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
@@ -1077,7 +1081,8 @@ initrational(void) {
npyrational_arrfuncs.fill = npyrational_fill;
npyrational_arrfuncs.fillwithscalar = npyrational_fillwithscalar;
/* Left undefined: scanfunc, fromstr, sort, argsort */
- npyrational_descr.ob_type = &PyArrayDescr_Type;
+ //npyrational_descr.ob_type = &PyArrayDescr_Type;
+ Py_TYPE(&npyrational_descr) = &PyArrayDescr_Type;
int npy_rational = PyArray_RegisterDataType(&npyrational_descr);
if (npy_rational<0) {
return;