get_long(): Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred(...).

This commit is contained in:
Fred Drake 1998-05-28 04:35:49 +00:00
parent bebc97fcd7
commit d3dbb38e98
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ get_long(v, p)
{
long x = PyInt_AsLong(v);
if (x == -1 && PyErr_Occurred()) {
if (PyErr_Occurred() == PyExc_TypeError)
if (PyErr_ExceptionMatches(PyExc_TypeError))
PyErr_SetString(StructError,
"required argument is not an integer");
return -1;