[Pyrex] [PATCH] public C-API and Py_ssize_t support for 0.9.5.1a
Stefan Behnel
stefan_ml at behnel.de
Mon Feb 12 15:40:23 UTC 2007
Hi,
thanks for the review!
Paul Metcalfe wrote:
> I think the patch might also break argument passing in Python calls
> when no arguments are passed:
>
> [extract from the patch]
>
> - "%s = PyObject_CallObject(%s, %s); if (!%s) %s" % (
> + "%s = PyObject_Call(%s, %s, 0); if (!%s) %s" % (
>
> The second argument of PyObject_CallObject may be a NULL pointer, but
> the second argument of PyObject_Call cannot be.
>
> [according to http://docs.python.org/api/object.html]
True, that's what the Python source code also says. Not sure this can actually
happen in the code that Pyrex generates, but PyObject_CallObject is definitely
the safer bet. And it's not even a real overhead.
Convinced, here's a new complete patch with the two fixes you came up with.
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyrex-0.9.5.1a-lxml.patch
Type: text/x-patch
Size: 24987 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20070212/a3cbb27c/attachment-0001.bin
More information about the Pyrex
mailing list