diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 17:49:41 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 17:49:41 (GMT) |
commit | 026019f89bf6669593d458dfa3ad9fc7b8d78bc2 (patch) | |
tree | a8d346de9c8006259fe7879d7c1b60aab62cca18 /Python/compile.c | |
parent | ee227ae7cf1f88e865c168a8f13743e92ade1938 (diff) | |
download | cpython-026019f89bf6669593d458dfa3ad9fc7b8d78bc2.zip cpython-026019f89bf6669593d458dfa3ad9fc7b8d78bc2.tar.gz cpython-026019f89bf6669593d458dfa3ad9fc7b8d78bc2.tar.bz2 |
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 a7ddc5a..57a2329 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; } |