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

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