remove generic try-except

If we do want to catch generic unexpected tracebacks,
this shouldn't be done here.

Note that `import discid` might raise OSError
when the python module is found, but not libdiscid itself.
We might want to catch that explicitely,
but that is supposed to be prevented by whoever made `discid` available.
This commit is contained in:
Johannes Dewender
2013-12-29 17:14:41 +01:00
parent 971927529f
commit e41bf6b054

View File

@@ -19,7 +19,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
import traceback
if sys.platform == 'win32':
from ctypes import windll
@@ -28,23 +27,21 @@ from PyQt4.QtCore import QFile, QRegExp, QIODevice, QString
from picard import config
from picard.util import uniqify
DEFAULT_DRIVES = []
try:
from libdiscid.compat import discid
except ImportError:
try:
from libdiscid.compat import discid
import discid
except ImportError:
try:
import discid
except ImportError:
discid = None
if discid is not None:
device = discid.get_default_device()
if device:
DEFAULT_DRIVES = [device]
except:
print(traceback.format_exc())
discid = None
DEFAULT_DRIVES = []
if discid is not None:
device = discid.get_default_device()
if device:
DEFAULT_DRIVES.append(device)
LINUX_CDROM_INFO = '/proc/sys/dev/cdrom/info'
# if get_cdrom_drives() lists all drives available on the machine