Add no-pygtkcompat.patch to avoid dependency on Gtk (boo#1110669)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Twisted?expand=0&rev=73
This commit is contained in:
2018-11-08 11:45:37 +00:00
committed by Git OBS Bridge
parent 43664fc1d3
commit 25c0ec88e2
3 changed files with 24 additions and 0 deletions

18
no-pygtkcompat.patch Normal file
View File

@@ -0,0 +1,18 @@
diff -ur Twisted-18.7.0.orig/src/twisted/internet/gireactor.py Twisted-18.7.0/src/twisted/internet/gireactor.py
--- Twisted-18.7.0.orig/src/twisted/internet/gireactor.py 2018-03-26 10:19:31.000000000 +0200
+++ Twisted-18.7.0/src/twisted/internet/gireactor.py 2018-10-04 01:41:32.547220235 +0200
@@ -75,8 +75,12 @@
# Newer version of gi, so we can try to initialize compatibility layer; if
# real pygtk was already imported we'll get ImportError at this point
# rather than segfault, so unconditional import is fine.
- import gi.pygtkcompat
- gi.pygtkcompat.enable()
+ try:
+ import gi.pygtkcompat
+ except ImportError:
+ pass # This is probably Python 3, with pygtkcompat removed
+ else:
+ gi.pygtkcompat.enable()
# At this point importing gobject will get you gi version, and importing
# e.g. gtk will either fail in non-segfaulty way or use gi version if user
# does gi.pygtkcompat.enable_gtk(). So, no need to prevent imports of

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Nov 8 10:28:09 CET 2018 - mcepl@suse.com
- Add no-pygtkcompat.patch to avoid dependency on Gtk (boo#1110669)
-------------------------------------------------------------------
Thu Nov 1 09:21:03 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -29,6 +29,7 @@ URL: http://twistedmatrix.com/
Source: https://files.pythonhosted.org/packages/source/T/Twisted/%{modname}-%{version}.tar.bz2
Patch1: skip_MultiCast.patch
Patch2: openssl111.patch
Patch3: no-pygtkcompat.patch
BuildRequires: %{python_module Automat >= 0.3.0}
BuildRequires: %{python_module PyHamcrest >= 1.9.0}
BuildRequires: %{python_module appdirs >= 1.4.0}