commit | 34ce99f66db84cabaaee04878e30aa8850518ce5 | [log] [tgz] |
---|---|---|
author | Yury Selivanov <yselivanov@sprymix.com> | Tue Feb 18 12:49:41 2014 -0500 |
committer | Yury Selivanov <yselivanov@sprymix.com> | Tue Feb 18 12:49:41 2014 -0500 |
tree | 3af6ed3869a6324c7a5014eef17658f9b097dca5 | |
parent | b59e4425d5476117b77db6a6ee9561f56b8a252a [diff] [blame] |
Mangle __parameters in __annotations__ dict properly. Issue #20625.
diff --git a/Python/compile.c b/Python/compile.c index a7ddc5a..57a2329 100644 --- a/Python/compile.c +++ b/Python/compile.c
@@ -1533,8 +1533,14 @@ { if (annotation) { VISIT(c, expr, annotation); - if (PyList_Append(names, id)) + PyObject *mangled = _Py_Mangle(c->u->u_private, id); + if (!mangled) return -1; + if (PyList_Append(names, mangled) < 0) { + Py_DECREF(mangled); + return -1; + } + Py_DECREF(mangled); } return 0; }