summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-01-31 01:37:35 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-01-31 01:37:35 (GMT)
commitabc7cd27ffa1194bc7671eeef2b46a4a03fe5b93 (patch)
tree402d6755751f4ccc1ff9c49eb9a29f7aba859343
parent1e6ada05334c877bf21ea7bb585458485f2814e6 (diff)
downloadcpython-abc7cd27ffa1194bc7671eeef2b46a4a03fe5b93.zip
cpython-abc7cd27ffa1194bc7671eeef2b46a4a03fe5b93.tar.gz
cpython-abc7cd27ffa1194bc7671eeef2b46a4a03fe5b93.tar.bz2
Backward branches are disgusting, at least when a forward branch
is just as easy.
-rw-r--r--Modules/datetimemodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 3ba2d18..520b01e 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -2548,12 +2548,8 @@ date_setstate(PyDateTime_Date *self, PyObject *arg)
int len;
unsigned char *pdata;
- if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1) {
- error:
- PyErr_SetString(PyExc_TypeError,
- "bad argument to date.__setstate__");
- return NULL;
- }
+ if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1)
+ goto error;
state = PyTuple_GET_ITEM(arg, 0);
if (!PyString_Check(state))
goto error;
@@ -2568,6 +2564,10 @@ date_setstate(PyDateTime_Date *self, PyObject *arg)
Py_INCREF(Py_None);
return Py_None;
+ error:
+ PyErr_SetString(PyExc_TypeError,
+ "bad argument to date.__setstate__");
+ return NULL;
}
static PyObject *