Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP4:Update
python3-Twisted.31482
no-pygtkcompat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File no-pygtkcompat.patch of Package python3-Twisted.31482
Index: Twisted-22.1.0/src/twisted/internet/gireactor.py =================================================================== --- Twisted-22.1.0.orig/src/twisted/internet/gireactor.py +++ Twisted-22.1.0/src/twisted/internet/gireactor.py @@ -21,20 +21,24 @@ On Python 3, pygobject v3.4 or later is """ -import gi.pygtkcompat # type: ignore[import] from gi.repository import GLib # type: ignore[import] from twisted.internet import _glibbase from twisted.internet.error import ReactorAlreadyRunning from twisted.python import runtime -# 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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor