From: Fred Drake Date: Fri, 22 Sep 2000 15:21:31 +0000 (+0000) Subject: When PyInt_FromLong() returns NULL, you do not need to check X-Git-Tag: v2.0b2~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=676940b49742309dd8914edc9ed276cfd38aa557;p=python When PyInt_FromLong() returns NULL, you do not need to check PyErr_Occurred(). Removed the extra test and setting of a bogus exception. --- diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 95a098098d..ce66e5a1ed 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -414,11 +414,9 @@ readinst(char *buf, int buf_size, PyObject *meth) PyObject *str = NULL; int len = -1; - if ((bytes = PyInt_FromLong(buf_size)) == NULL) { - if (!PyErr_Occurred()) - PyErr_SetNone(PyExc_EOFError); + if ((bytes = PyInt_FromLong(buf_size)) == NULL) goto finally; - } + if ((arg = PyTuple_New(1)) == NULL) goto finally;