From 1f1862e44478ae14670cc9ca8cb889127d1a70f1 Mon Sep 17 00:00:00 2001 From: John (J5) Palmieri Date: Tue, 28 Sep 2010 15:49:37 -0400 Subject: [PATCH] use PyCapsule API instead of the deprecated PyCObject API * PyCObject is deprecated in 3.1 and removed in 3.2 https://bugs.freedesktop.org/show_bug.cgi?id=30289 --- src/cairomodule.c | 2 +- src/py3cairo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cairomodule.c b/src/cairomodule.c index 58e665c..144757a 100644 --- a/src/cairomodule.c +++ b/src/cairomodule.c @@ -377,7 +377,7 @@ PyInit__cairo(void) (PyObject *)&PycairoXlibSurface_Type); #endif - PyModule_AddObject(m, "CAPI", PyCObject_FromVoidPtr(&CAPI, NULL)); + PyModule_AddObject(m, "CAPI", PyCapsule_New(&CAPI, "cairo.CAPI", NULL)); /* constants */ #if CAIRO_HAS_ATSUI_FONT diff --git a/src/py3cairo.h b/src/py3cairo.h index 35b4240..d919d3c 100644 --- a/src/py3cairo.h +++ b/src/py3cairo.h @@ -199,7 +199,7 @@ typedef struct { * 2) Add 'Pycairo_IMPORT;' to the init function */ #define Pycairo_IMPORT \ - Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI") + Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import("cairo.CAPI", 0) #endif /* ifndef _INSIDE_PYCAIRO_ */ -- 1.7.2.3