mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Backward branches are disgusting, at least when a forward branch
is just as easy.
This commit is contained in:
parent
1e6ada0533
commit
abc7cd27ff
1 changed files with 6 additions and 6 deletions
|
@ -2548,12 +2548,8 @@ date_setstate(PyDateTime_Date *self, PyObject *arg)
|
||||||
int len;
|
int len;
|
||||||
unsigned char *pdata;
|
unsigned char *pdata;
|
||||||
|
|
||||||
if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1) {
|
if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1)
|
||||||
error:
|
goto error;
|
||||||
PyErr_SetString(PyExc_TypeError,
|
|
||||||
"bad argument to date.__setstate__");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
state = PyTuple_GET_ITEM(arg, 0);
|
state = PyTuple_GET_ITEM(arg, 0);
|
||||||
if (!PyString_Check(state))
|
if (!PyString_Check(state))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -2568,6 +2564,10 @@ date_setstate(PyDateTime_Date *self, PyObject *arg)
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
|
error:
|
||||||
|
PyErr_SetString(PyExc_TypeError,
|
||||||
|
"bad argument to date.__setstate__");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue