[transmageddon] Avoid exceptions on DVD detection



commit 7e7e5833138fa94ddc71ed3e039c20ef183491d7
Author: Alberto Ruiz <aruiz gnome org>
Date:   Sat Mar 15 10:30:24 2014 +0100

    Avoid exceptions on DVD detection

 src/transmageddon.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/transmageddon.py b/src/transmageddon.py
index fd734f6..c4a92cd 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -1341,8 +1341,12 @@ class TransmageddonUI(Gtk.ApplicationWindow):
            self.finder_disc_lost = self.finder.connect("disc-lost",
                                                         self.on_disc_lost)
 
-       lsdvdexist = which.which("lsdvd")
-       if self.dvdname[0] and lsdvdexist: # only use this option is there is a DVD and ldvd is installed
+       try:
+         lsdvdexist = which.which("lsdvd")
+       except:
+         lsdvdexist = False
+
+       if len(self.dvdname) > 0 and lsdvdexist: # only use this option is there is a DVD and ldvd is 
installed
            theme = Gtk.IconTheme.get_default()
            size= Gtk.icon_size_lookup(Gtk.IconSize.MENU)[1]
            cdrom=theme.load_icon(Gtk.STOCK_CDROM, size, 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]