diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-06-27 13:56:46 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-06-27 13:56:46 -0500 |
commit | 5942fb553b4d2bed2f760e87bf8fab8111eb3eed (patch) | |
tree | 4a74a687f79c320dffd41be6d215349d5bcc750e /Python/modsupport.c | |
parent | 765145f23b442f5f41273ca404d7771d8cb73a7f (diff) | |
parent | 01d6a2372715e75c665320407bd1cf27be7fc94d (diff) | |
download | cpython-5942fb553b4d2bed2f760e87bf8fab8111eb3eed.tar.gz |
merge 3.3
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r-- | Python/modsupport.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c index 428914f378..6c938ddd79 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -161,7 +161,17 @@ do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags) /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ for (i = 0; i < n; i++) { - PyObject *w = do_mkvalue(p_format, p_va, flags); + PyObject *w; + + if (itemfailed) { + PyObject *exception, *value, *tb; + PyErr_Fetch(&exception, &value, &tb); + w = do_mkvalue(p_format, p_va, flags); + PyErr_Restore(exception, value, tb); + } + else { + w = do_mkvalue(p_format, p_va, flags); + } if (w == NULL) { itemfailed = 1; Py_INCREF(Py_None); |