[issue35879] test_type_comments leaks references

Pablo Galindo Salgado report at bugs.python.org
Fri Feb 1 12:22:50 EST 2019


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

The extra referenced happen here in Python-ast.c :

value = ast2obj_string(o->type_comment);
    if (!value) goto failed;
    if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
        goto failed;
    Py_DECREF(value);

ast2obj_string increments it once and the setattr does it again and then there is only one Py_DECREF.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35879>
_______________________________________


More information about the Python-bugs-list mailing list