diff options
author | Barry Warsaw <barry@python.org> | 2000-08-18 05:05:37 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2000-08-18 05:05:37 +0000 |
commit | ee7940d7f9672a3bba0eba1328d44ed03e6e6ca8 (patch) | |
tree | a422c937a37abded53006030a302b5038ea04cee /Python/exceptions.c | |
parent | 44292f56bd7c375ddc707f4596572f6b0e11c304 (diff) | |
download | cpython-ee7940d7f9672a3bba0eba1328d44ed03e6e6ca8.tar.gz |
SyntaxError__classinit__(): Slight reorg for simplicity.
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r-- | Python/exceptions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c index 690af7e92e..b441f51784 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -647,6 +647,7 @@ SyntaxError__doc__[] = "Invalid syntax."; static int SyntaxError__classinit__(PyObject *klass) { + int retval = 0; PyObject *emptystring = PyString_FromString(""); /* Additional class-creation time initializations */ @@ -657,11 +658,10 @@ SyntaxError__classinit__(PyObject *klass) PyObject_SetAttrString(klass, "offset", Py_None) || PyObject_SetAttrString(klass, "text", Py_None)) { - Py_XDECREF(emptystring); - return -1; + retval = -1; } - Py_DECREF(emptystring); - return 0; + Py_XDECREF(emptystring); + return retval; } |