diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 12:49:41 -0500 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 12:49:41 -0500 |
commit | 4feb97d3923c246e9ee39c326309ec206b200a49 (patch) | |
tree | 9f002ec38b856a99845d02a1ba38314de22a677b /Python/compile.c | |
parent | 4f3e7e4195745d497a10a1dbd1364643ad349184 (diff) | |
download | cpython-4feb97d3923c246e9ee39c326309ec206b200a49.tar.gz |
Mangle __parameters in __annotations__ dict properly. Issue #20625.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index a7ddc5a11a..57a232919d 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1533,8 +1533,14 @@ compiler_visit_argannotation(struct compiler *c, identifier id, { 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; } |