2013/7/17 Serhiy Storchaka <storch...@gmail.com>:
> Oh, I meaned Py_XDECREF.

Ah ok :-) Well, for this specific code, it can probably be replaced with:

         if (_PyBytes_Resize(&bytes, n) < 0)
             return NULL;

I'm not sure that _PyBytes_Resize() *always* decref bytes and then set
bytes to NULL. I was too lazy to check this.

If someone wants to audit the code of _PyBytes_Resize(), there are
many other places where Py_XDECREF / Py_CLEAR can be removed on
_PyBytes_Resize() failure.

And I'm quite sure that there are still places where Py_DECREF() is
still used on _PyBytes_Resize() failure ;-)

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to