8000 Python/modsupport.c · python/cpython@28b8284 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28b8284

Browse files
committed
Python/modsupport.c
1 parent 09b9102 commit 28b8284

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Python/modsupport.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,12 @@ static PyObject *do_mkvalue(const char**, va_list *, int);
9393
static void
9494
do_ignore(const char **p_format, va_list *p_va, char endchar, Py_ssize_t n, int flags)
9595
{
96-
PyObject *v;
97-
Py_ssize_t i;
9896
assert(PyErr_Occurred());
99-
v = PyTuple_New(n);
100-
for (i = 0; i < n; i++) {
101-
PyObject *exception, *value, *tb, *w;
102-
103-
PyErr_Fetch(&exception, &value, &tb);
104-
w = do_mkvalue(p_format, p_va, flags);
105-
PyErr_Restore(exception, value, tb);
97+
PyObject *v = PyTuple_New(n);
98+
for (Py_ssize_t i = 0; i < n; i++) {
99+
PyObject *exc = PyErr_GetRaisedException();
100+
PyObject *w = do_mkvalue(p_format, p_va, flags);
101+
PyErr_SetRaisedException(exc);
106102
if (w != NULL) {
107103
if (v != NULL) {
108104
PyTuple_SET_ITEM(v, i, w);

0 commit comments

Comments
 (0)
0