Skip to content

Commit 24cdbd6

Browse files
committed
BUG: raise error for invalid numpy int conversion
1 parent 0832b07 commit 24cdbd6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/extensions/srreal_converters.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ int extractint(boost::python::object obj)
304304
if (PyArray_CheckScalar(pobj))
305305
{
306306
int rv = PyArray_PyIntAsInt(pobj);
307+
if (rv == -1 && PyErr_Occurred()) python::throw_error_already_set();
307308
return rv;
308309
}
309310
// nothing worked, call geti which will raise an exception

0 commit comments

Comments
 (0)