[issue27703] Replace two Py_XDECREFs with Py_DECREFs in do_raise

Raymond Hettinger report at bugs.python.org
Sun Aug 7 18:28:31 EDT 2016


Raymond Hettinger added the comment:

Have you checked all the possibly code paths to be sure?   "Seems to be unnecessary" is insufficient reason for undoing Guido's code that has stood since 1997.   


Looking at the snarl of possible code paths, I not finding it obvious why some of the paths require Py_XDECREF and others don't.   Even if you are sure, then the patch needs to include assertions at key checkpoints (i.e. after a given assignment to "type" or "value" can we reliably assert the value is non-null) and/or comments showing what the reasoning is.  Otherwise, even if the patch happens to be correct, it increases the risk that future maintenance will introduce a bug when the current code would have allowed the maintenance in a safer context.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27703>
_______________________________________


More information about the Python-bugs-list mailing list