File lp1102685.diff of Package python-Twisted (Revision cfeeefdeeac9bfebf7009313cf810cc4)
Currently displaying revision cfeeefdeeac9bfebf7009313cf810cc4 , Show latest
35
1
=== modified file 'twisted/internet/gireactor.py'
2
Index: Twisted-15.0.0/twisted/internet/gireactor.py
3
===================================================================
4
--- Twisted-15.0.0.orig/twisted/internet/gireactor.py
5
+++ Twisted-15.0.0/twisted/internet/gireactor.py
6
7
from twisted.python.modules import theSystemPath
8
_pygtkcompatPresent = True
9
try:
10
- theSystemPath["gi.pygtkcompat"]
11
+ theSystemPath["pygtkcompat"]
12
except KeyError:
13
- _pygtkcompatPresent = False
14
+ try:
15
+ theSystemPath["gi.pygtkcompat"]
16
+ except KeyError:
17
+ _pygtkcompatPresent = False
18
19
20
# Modules that we want to ensure aren't imported if we're on older versions of
21
22
# Newer version of gi, so we can try to initialize compatibility layer; if
23
# real pygtk was already imported we'll get ImportError at this point
24
# rather than segfault, so unconditional import is fine.
25
- import gi.pygtkcompat
26
- gi.pygtkcompat.enable()
27
+ try:
28
+ import pygtkcompat
29
+ except ImportError:
30
+ from gi import pygtkcompat
31
+ pygtkcompat.enable()
32
# At this point importing gobject will get you gi version, and importing
33
# e.g. gtk will either fail in non-segfaulty way or use gi version if user
34
# does gi.pygtkcompat.enable_gtk(). So, no need to prevent imports of
35