updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / avogadro-git / fix-pycapsule.patch
blobde4e2ca75b7da0bacda5d5ffc6eccde2286325ba
1 --- avogadro-1.0.1/libavogadro/src/python/sip.cpp 2010-05-02 17:31:22.000000000 +0100
2 +++ avogadro-1.0.1-pycapsule/libavogadro/src/python/sip.cpp 2010-11-23 19:00:09.000000000 +0000
3 @@ -62,12 +62,20 @@ bool init_sip_api()
4 return false;
7 +#ifdef SIP_USE_PYCAPSULE
8 + if (!PyCapsule_IsValid(sip_capi_obj.ptr(), "sip._C_API")) {
9 +#else
10 if (!PyCObject_Check(sip_capi_obj.ptr())) {
11 +#endif
12 std::cout << "The _C_API object in the sip python module is invalid." << std::endl;
13 return false;
16 +#ifdef SIP_USE_PYCAPSULE
17 + sip_API = reinterpret_cast<const sipAPIDef*>(PyCapsule_GetPointer(sip_capi_obj.ptr(), "sip._C_API"));
18 +#else
19 sip_API = reinterpret_cast<const sipAPIDef*>(PyCObject_AsVoidPtr(sip_capi_obj.ptr()));
20 +#endif
22 return true;