Skip to content

Commit

Permalink
BUG: use PyErr_Warn instead of WarnEx on Py2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Dec 10, 2009
1 parent 977e436 commit 5053c6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions numpy/core/src/multiarray/convert_datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,15 @@ PyArray_GetCastFunc(PyArray_Descr *descr, int type_num)
cls = PyObject_GetAttrString(obj, "ComplexWarning");
Py_DECREF(obj);
}
#if PY_VERSION_HEX >= 0x02050000
PyErr_WarnEx(cls,
"Casting complex values to real discards the imaginary "
"part", 0);
#else
PyErr_Warn(cls,
"Casting complex values to real discards the imaginary "
"part");
#endif
Py_XDECREF(cls);
}
if (castfunc) {
Expand Down

0 comments on commit 5053c6f

Please sign in to comment.