mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Mangle __parameters in __annotations__ dict properly. Issue #20625.
This commit is contained in:
parent
b59e4425d5
commit
34ce99f66d
5 changed files with 37 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue