diff --git a/no-pygtkcompat.patch b/no-pygtkcompat.patch new file mode 100644 index 0000000..59eb1df --- /dev/null +++ b/no-pygtkcompat.patch @@ -0,0 +1,32 @@ +diff -ur Twisted-21.7.0.orig/src/twisted/internet/gireactor.py Twisted-21.7.0/src/twisted/internet/gireactor.py +--- Twisted-21.7.0.orig/src/twisted/internet/gireactor.py ++++ Twisted-21.7.0/src/twisted/internet/gireactor.py +@@ -24,16 +24,21 @@ + from twisted.internet.error import ReactorAlreadyRunning + from twisted.internet import _glibbase + from twisted.python import runtime +-import gi.pygtkcompat # type: ignore[import] + from gi.repository import GLib # type: ignore[import] + +-# We require a sufficiently new version of pygobject, so always exists: +-_pygtkcompatPresent = True ++try: ++ import gi.pygtkcompat # type: ignore[import] ++except ImportError: ++ pass # This is probably Python 3, with pygtkcompat removed ++else: ++ # We require a sufficiently new version of pygobject, so always exists: ++ _pygtkcompatPresent = True ++ ++ # 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. ++ gi.pygtkcompat.enable() + +-# 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. +-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 diff --git a/python-Twisted.changes b/python-Twisted.changes index 0b3f04e..0e24d38 100644 --- a/python-Twisted.changes +++ b/python-Twisted.changes @@ -3,6 +3,11 @@ Mon Aug 2 06:41:10 UTC 2021 - Markéta Machová - typing_extensions is now required +------------------------------------------------------------------- +Sat Jul 31 08:25:30 UTC 2021 - Michael Gumsley + +- Restore no-pygtkcompat.patch due to boo#1110669 + ------------------------------------------------------------------- Sat Jul 31 04:27:55 UTC 2021 - Matej Cepl diff --git a/python-Twisted.spec b/python-Twisted.spec index b4a0d9f..a51cffb 100644 --- a/python-Twisted.spec +++ b/python-Twisted.spec @@ -36,6 +36,8 @@ Patch2: no-test_successResultOfWithFailureHasTraceback.patch Patch3: 1521_delegate_parseqs_stdlib_bpo42967.patch # We don't want to package yet another module, and it is easily skippable Patch4: no-cython_test_exception_raiser.patch +# boo#1110669 Our variant of PyGObject has pygtkcompat stripped which Twisted does not handle +Patch5: no-pygtkcompat.patch BuildRequires: %{python_module Automat >= 0.8.0} BuildRequires: %{python_module PyHamcrest >= 1.9.0} BuildRequires: %{python_module appdirs >= 1.4.0}