summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-05-28 04:33:37 (GMT)
committerFred Drake <fdrake@acm.org>1998-05-28 04:33:37 (GMT)
commit764b984db508f40d7add9162920681827f3f22d5 (patch)
treeb3e781c1a6c27637d2b8307b2aebbd6ce6e771e6 /Modules
parent2b9d029308212b5a197120df5ad38128438bb604 (diff)
downloadcpython-764b984db508f40d7add9162920681827f3f22d5.zip
cpython-764b984db508f40d7add9162920681827f3f22d5.tar.gz
cpython-764b984db508f40d7add9162920681827f3f22d5.tar.bz2
Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in two
places.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 9f426cc..6c70ad9 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -3533,7 +3533,8 @@ load(Unpicklerobject *self) {
break;
}
- if ((err = PyErr_Occurred()) == PyExc_EOFError) {
+ err = PyErr_Occurred();
+ if (err && PyErr_ExceptionMatches(PyExc_EOFError)) {
PyErr_SetNone(PyExc_EOFError);
goto err;
}
@@ -3830,7 +3831,8 @@ noload(Unpicklerobject *self) {
break;
}
- if ((err = PyErr_Occurred()) == PyExc_EOFError) {
+ err = PyErr_Occurred();
+ if (err && PyErr_ExceptionMatches(PyExc_EOFError)) {
PyErr_SetNone(PyExc_EOFError);
goto err;
}