Blame SOURCES/0001-Import-gobject-from-gi.repository-in-Python-3.patch

39c17f
From 2e99044f6785e9bd0c252cee4349feab9bb9bb66 Mon Sep 17 00:00:00 2001
39c17f
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
39c17f
Date: Wed, 22 May 2019 18:13:32 +0200
39c17f
Subject: [PATCH 1/2] Import gobject from gi.repository in Python 3
39c17f
MIME-Version: 1.0
39c17f
Content-Type: text/plain; charset=UTF-8
39c17f
Content-Transfer-Encoding: 8bit
39c17f
39c17f
Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
39c17f
---
39c17f
 src/twisted/internet/gtk2reactor.py | 5 ++++-
39c17f
 1 file changed, 4 insertions(+), 1 deletion(-)
39c17f
39c17f
diff --git a/src/twisted/internet/gtk2reactor.py b/src/twisted/internet/gtk2reactor.py
39c17f
index faf123464..19d97445c 100644
39c17f
--- a/src/twisted/internet/gtk2reactor.py
39c17f
+++ b/src/twisted/internet/gtk2reactor.py
39c17f
@@ -43,7 +43,10 @@ try:
39c17f
 except (ImportError, AttributeError):
39c17f
     pass  # maybe we're using pygtk before this hack existed.
39c17f
 
39c17f
-import gobject
39c17f
+try:
39c17f
+    import gobject
39c17f
+except ImportError:
39c17f
+    from gi.repository import GObject as gobject
39c17f
 
39c17f
 if hasattr(gobject, "threads_init"):
39c17f
     # recent versions of python-gtk expose this. python-gtk=2.4.1
39c17f
-- 
39c17f
2.21.0
39c17f