[pygobject] foreign-cairo: Enable cairo.Region support also on Python 2 if available



commit a2cb674334267e3eaeac5b2ce849c4a38cc1b428
Author: Christoph Reiter <creiter src gnome org>
Date:   Sun Apr 9 18:48:33 2017 +0200

    foreign-cairo: Enable cairo.Region support also on Python 2 if available
    
    The next pycairo version might add support for cairo_region_t.
    This enables the converter functions also on Python 2 and makes
    sure that the test suite does not crash in case it does.

 gi/pygi-foreign-cairo.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
index ad1d5c0..682cee2 100644
--- a/gi/pygi-foreign-cairo.c
+++ b/gi/pygi-foreign-cairo.c
@@ -367,7 +367,7 @@ cairo_pattern_from_gvalue (const GValue *value)
     return PycairoPattern_FromPattern (pattern, NULL);
 }
 
-#if PY_VERSION_HEX >= 0x03000000 && defined(PycairoRegion_Type)
+#if defined(PycairoRegion_Type)
 
 static PyObject *
 cairo_region_to_arg (PyObject        *value,
@@ -449,7 +449,7 @@ PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
                                   cairo_font_options_from_arg,
                                   cairo_font_options_release);
 
-#if PY_VERSION_HEX >= 0x03000000 && defined(PycairoRegion_Type)
+#if defined(PycairoRegion_Type)
     pygi_register_foreign_struct ("cairo",
                                   "Region",
                                   cairo_region_to_arg,


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