fix check of presence of X server. Fixes #3481
This commit is contained in:
parent
bbb7f5b0d4
commit
d6aa63cd1c
1 changed files with 11 additions and 6 deletions
17
src/gajim.py
17
src/gajim.py
|
@ -113,6 +113,17 @@ del config_path
|
||||||
common.configpaths.gajimpaths.init_profile(profile)
|
common.configpaths.gajimpaths.init_profile(profile)
|
||||||
del profile
|
del profile
|
||||||
|
|
||||||
|
# PyGTK2.10+ only throws a warning
|
||||||
|
import warnings
|
||||||
|
warnings.filterwarnings('error', module='gtk')
|
||||||
|
try:
|
||||||
|
import gtk
|
||||||
|
except Warning, msg:
|
||||||
|
if str(msg) == 'could not open display':
|
||||||
|
print >> sys.stderr, _('Gajim needs X server to run. Quiting...')
|
||||||
|
sys.exit()
|
||||||
|
warnings.resetwarnings()
|
||||||
|
|
||||||
import message_control
|
import message_control
|
||||||
|
|
||||||
from chat_control import ChatControlBase
|
from chat_control import ChatControlBase
|
||||||
|
@ -134,12 +145,6 @@ if os.name == 'posix': # dl module is Unix Only
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
|
||||||
import gtk
|
|
||||||
except RuntimeError, msg:
|
|
||||||
if str(msg) == 'could not open display':
|
|
||||||
print >> sys.stderr, _('Gajim needs X server to run. Quiting...')
|
|
||||||
sys.exit()
|
|
||||||
pritext = ''
|
pritext = ''
|
||||||
if gtk.pygtk_version < (2, 8, 0):
|
if gtk.pygtk_version < (2, 8, 0):
|
||||||
pritext = _('Gajim needs PyGTK 2.8 or above')
|
pritext = _('Gajim needs PyGTK 2.8 or above')
|
||||||
|
|
Loading…
Add table
Reference in a new issue