Tal Einat added the comment:

Found two bugs in the draft patch in Objects/longobject.c:

1) In _PyLong_NullableIntConverter, there is no index variable, so the 
Py_DECREF and Py_XDECREF need to be removed from the end of the function.

2) In _PyLong_NullablePy_ssize_tConverter, the index variable will point to a 
Python object only when both if blocks are skipped. Therefore, the Py_XDECREF 
after "fail:" at the end of the function needs to be removed.

With these two changes, I successfully used this patch to convert deque_init in 
Modules/_collectionsmodule.c, simplifying the input validation code 
considerably.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to