[pygobject] [python3] fix build. PYcairo_IMPORT doesn't exists anymore



commit 4e5833d0c2fe548617e5ea510f05920fd0caf73b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Apr 21 16:52:20 2011 +0200

    [python3] fix build. PYcairo_IMPORT doesn't exists anymore

 gi/pygi-foreign-cairo.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
index 10d5643..8353294 100644
--- a/gi/pygi-foreign-cairo.c
+++ b/gi/pygi-foreign-cairo.c
@@ -30,7 +30,7 @@
 #include <pycairo/py3cairo.h>
 #endif
 
-Pycairo_CAPI_t *Pycairo_CAPI;
+static Pycairo_CAPI_t *Pycairo_CAPI;
 
 #include "pygi-foreign.h"
 
@@ -115,7 +115,12 @@ cairo_surface_release (GIBaseInfo *base_info,
 static PyMethodDef _gi_cairo_functions[] = {};
 PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
 {
+#if PY_VERSION_HEX < 0x03000000
     Pycairo_IMPORT;
+#else
+    Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI");
+#endif
+
     if (Pycairo_CAPI == NULL)
         return PYGLIB_MODULE_ERROR_RETURN;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]