]> sigrok.org Git - libsigrok.git/blobdiff - bindings/python/sigrok/core/classes.i
python: Fix the build for Python >= 3.
[libsigrok.git] / bindings / python / sigrok / core / classes.i
index 2afe579124196e42f7782c95da099dc2e8c858f9..93e03ef29e5203d9e45035a22da2aa7e93815fc8 100644 (file)
@@ -75,7 +75,11 @@ typedef guint pyg_flags_type;
      */
     if (!GLib) {
         fprintf(stderr, "Import of gi.repository.GLib failed.\n");
+#if PY_VERSION_HEX >= 0x03000000
+        return NULL;
+#else
         return;
+#endif
     }
     IOChannel = (PyTypeObject *) PyObject_GetAttrString(GLib, "IOChannel");
     PollFD = (PyTypeObject *) PyObject_GetAttrString(GLib, "PollFD");