summaryrefslogtreecommitdiff
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2014-09-17 13:19:01 +0800
committerSenthil Kumaran <senthil@uthcode.com>2014-09-17 13:19:01 +0800
commitebf0eb89938ef3da56660bb4b8e043d73311d5f4 (patch)
treeceb9977286425825740876df5d7349e19f131c38 /Python/modsupport.c
parent8f9f5f2448be5f6d261011e2cf16ce1d9e733fc4 (diff)
parent7512258fade04669b3fa38b313372fbd2c04cf47 (diff)
downloadcpython-ebf0eb89938ef3da56660bb4b8e043d73311d5f4.tar.gz
Merge from 3.3
Issue #22421 - Secure pydoc server run. Bind it to localhost instead of all interfaces.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c12
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);