Fix traceback on linux when VLC isn't installed. Fixes bug 1489143.

Fixes: https://launchpad.net/bugs/1489143
This commit is contained in:
Tomas Groth 2015-08-26 22:37:23 +01:00
parent f36a9c29dc
commit f98c35df94
1 changed files with 2 additions and 4 deletions

View File

@ -80,10 +80,8 @@ def get_vlc():
if is_win():
if not isinstance(e, WindowsError) and e.winerror != 126:
raise
elif is_macosx():
pass
else:
raise
pass
if is_vlc_available:
try:
VERSION = vlc.libvlc_get_version().decode('UTF-8')
@ -103,7 +101,7 @@ def get_vlc():
# On linux we need to initialise X threads, but not when running tests.
# This needs to happen on module load and not in get_vlc(), otherwise it can cause crashes on some DE on some setups
# (reported on Gnome3, Unity, Cinnamon, all GTK+ based) when using native filedialogs...
if get_vlc() and is_linux() and 'nose' not in sys.argv[0]:
if is_linux() and 'nose' not in sys.argv[0] and get_vlc():
import ctypes
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')