Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3dbb38

Browse files
committed
get_long(): Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred(...).
1 parent bebc97f commit d3dbb38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/structmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ get_long(v, p)
107107
{
108108
long x = PyInt_AsLong(v);
109109
if (x == -1 && PyErr_Occurred()) {
110-
if (PyErr_Occurred() == PyExc_TypeError)
110+
if (PyErr_ExceptionMatches(PyExc_TypeError))
111111
PyErr_SetString(StructError,
112112
"required argument is not an integer");
113113
return -1;

0 commit comments

Comments
 (0)