[Numpy-discussion] Can not compile numpy with python2.7 onllinux
Nadav Horesh
nadavh at visionsense.com
Mon May 24 07:23:33 EDT 2010
That it, you just have to add the missing #endif after
m = Py_InitModule .....
Thank you,
Nadav.
-----Original Message-----
From: numpy-discussion-bounces at scipy.org on behalf of Charles R Harris
Sent: Sun 23-May-10 20:48
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Can not compile numpy with python2.7 onllinux
On Sun, May 23, 2010 at 1:40 AM, Nadav Horesh <nadavh at visionsense.com>wrote:
>
> I think that line 3405 in _capi.c (svn 8386)
> should be:
>
> #if PY_VERSION_HEX >= 0x03010000
>
>
> (At least it looks reasonable considering line 3375, and it solves my
> problem)
>
>
Does the following work? PyCObject is deprecated in 2.7.
#if PY_VERSION_HEX >= 0x03010000
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("_capi", _libnumarrayMethods);
#if PY_VERSION_HEX >= 0x02070000
c_api_object = PyCapsule_New((void *)libnumarray_API, NULL, NULL);
if (c_api_object == NULL) {
PyErr_Clear();
}
#else
c_api_object = PyCObject_FromVoidPtr((void *)libnumarray_API, NULL);
#endif
Chuck
> Nadav
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3397 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100524/1d316ff6/attachment.bin>
More information about the NumPy-Discussion
mailing list