chiark
/
gitweb
/
~mdw
/
catacomb-python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2d3325
)
key.c: Collect `KeyError' argument count as a separate step.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 24 Nov 2019 16:21:09 +0000
(16:21 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 27 Nov 2019 15:10:44 +0000
(15:10 +0000)
key.c
patch
|
blob
|
blame
|
history
diff --git
a/key.c
b/key.c
index dc1b849b759fec7315621fe6c7a83935877fb5aa..499503504d47a49adbd1f5962a15f7d25c067c30 100644
(file)
--- a/
key.c
+++ b/
key.c
@@
-38,7
+38,9
@@
static PyObject *kxmeth___init__(PyObject *me, PyObject *arg)
{
int err;
PyObject *x = 0;
{
int err;
PyObject *x = 0;
+ Py_ssize_t n;
+ n = PyTuple_GET_SIZE(arg);
if (!PyArg_ParseTuple(arg, "Oi:__init__", &me, &err) ||
(x = PyInt_FromLong(err)) == 0 ||
PyObject_SetAttrString(me, "err", x))
if (!PyArg_ParseTuple(arg, "Oi:__init__", &me, &err) ||
(x = PyInt_FromLong(err)) == 0 ||
PyObject_SetAttrString(me, "err", x))
@@
-48,7
+50,7
@@
static PyObject *kxmeth___init__(PyObject *me, PyObject *arg)
PyObject_SetAttrString(me, "errstring", x))
goto end;
Py_DECREF(x); x = 0;
PyObject_SetAttrString(me, "errstring", x))
goto end;
Py_DECREF(x); x = 0;
- if ((x = PyTuple_GetSlice(arg, 1,
PyTuple_GET_SIZE(arg)
)) == 0 ||
+ if ((x = PyTuple_GetSlice(arg, 1,
n
)) == 0 ||
PyObject_SetAttrString(me, "args", x))
goto end;
Py_DECREF(x); x = 0;
PyObject_SetAttrString(me, "args", x))
goto end;
Py_DECREF(x); x = 0;