15
0
Files
python-Twisted/no-pygtkcompat.patch
Steve Kowalik b19a638d00 - Update to 22.10.0:
* Features
    + twisted.internet.defer.maybeDeferred will now schedule a coroutine
      result as asynchronous operation and return a Deferred that fires with
      the result of the coroutine.
    + Twisted now works with Cryptography versions 37 and above, and as a
      result, its minimum TLS protocol version has been upgraded to TLSv1.2.
    + The systemd: endpoint parser now supports "named" file descriptors. This
      is a more reliable mechanism for choosing among several inherited
      descriptors.
  * Bugfixes
    + twisted.internet.base.DelayedCall.__repr__ will no longer raise
      AttributeError if the DelayedCall was created before debug mode was
      enabled. As a side-effect, twisted.internet.base.DelayedCall.creator is
      now defined as None in cases where previously it was undefined.
    + twisted.internet.iocpreactor.udp now properly re-queues its listener
      when there is a failure condition on the read from the socket.
    + twisted.internet.defer.inlineCallbacks no longer causes confusing
      StopIteration tracebacks to be added to the top of tracebacks
      originating in triggered callbacks.
    + The typing of twisted.internet.task.react no longer constrains the
      type of argv.
    + ContextVar.reset() now works correctly inside inlineCallbacks functions
      and coroutines.
    + Implement twisted.python.failure._Code.co_positions for compatibility
      with Python 3.11.
    + twisted.pair.tuntap._TUNSETIFF and ._TUNGETIFF values are now correct
      parisc, powerpc and sparc architectures. 
    + twisted.web.vhost.NameVirtualHost will no longerreturn a NoResource
      error. (bsc#1204781, CVE-2022-39348)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Twisted?expand=0&rev=125
2022-11-01 05:50:34 +00:00

37 lines
1.6 KiB
Diff

Index: Twisted-22.10.0/src/twisted/internet/gireactor.py
===================================================================
--- Twisted-22.10.0.orig/src/twisted/internet/gireactor.py
+++ Twisted-22.10.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