Skip to content

Commit

Permalink
Added cast to error check, and fixed indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfode committed Jul 15, 2012
1 parent 120c6bd commit 78f6672
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/core/src/multiarray/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ _array_find_python_scalar_type(PyObject *op)
/* if integer can fit into a longlong then return that*/
if ((PyLong_AsLongLong(op) == -1) && PyErr_Occurred()) {
PyErr_Clear();
if((PyLong_AsUnsignedLongLong(op) == -1) && PyErr_Occurred()){
PyErr_Clear();
if ((PyLong_AsUnsignedLongLong(op) == (unsigned long long) -1)
&& PyErr_Occurred()){
PyErr_Clear();
}
else {
return PyArray_DescrFromType(NPY_ULONGLONG);
Expand Down

0 comments on commit 78f6672

Please sign in to comment.