diff options
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/errors.c | 10 | ||||
| -rw-r--r-- | Python/getargs.c | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Python/errors.c b/Python/errors.c index c88a190..615da19 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -219,7 +219,15 @@ finally: tstate = PyThreadState_GET(); if (++tstate->recursion_depth > Py_GetRecursionLimit()) { --tstate->recursion_depth; - PyErr_SetObject(PyExc_RuntimeError, PyExc_RecursionErrorInst); + /* throw away the old exception... */ + Py_DECREF(*exc); + Py_DECREF(*val); + /* ... and use the recursion error instead */ + *exc = PyExc_RuntimeError; + *val = PyExc_RecursionErrorInst; + Py_INCREF(*exc); + Py_INCREF(*val); + /* just keeping the old traceback */ return; } PyErr_NormalizeException(exc, val, tb); diff --git a/Python/getargs.c b/Python/getargs.c index 544948b..d24857d 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -1108,7 +1108,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, != size) { Py_DECREF(s); return converterr( - "(encoded string without NULL bytes)", + "encoded string without NULL bytes", arg, msgbuf, bufsize); } *buffer = PyMem_NEW(char, size + 1); |
