Amaury Forgeot d'Arc added the comment:
- For the replacement with NULL, Py_CLEAR() should be used instead.
- We should use a macro (Py_REF_ASSIGN?) for the replacement case.
- Careful, in Modules/_json.c the code is wrong because tmp is already used::
PyObject *tmp = PyUnicode_AsEncodedString(...);
{
PyObject *tmp = s->encoding;
s->encoding = tmp;
Py_DECREF(tmp);
}
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16447>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com