diff Modules/structmodule.c @ 8434:ae746eab2a96 legacy-trunk

get_long(): Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred(...).
author Fred Drake <fdrake@acm.org>
date Thu, 28 May 1998 04:35:49 +0000
parents a909a2869ac5
children 1ca6895024d9
line wrap: on
line diff
--- a/Modules/structmodule.c	Thu May 28 04:35:12 1998 +0000
+++ b/Modules/structmodule.c	Thu May 28 04:35:49 1998 +0000
@@ -107,7 +107,7 @@
 {
 	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;