Catch specific exceptions

This commit is contained in:
Antonio Larrosa
2018-08-01 10:30:34 +02:00
parent 7af9ca9d75
commit 497d4ecb74

View File

@@ -357,12 +357,12 @@ class ClusterInfoDialog(InfoDialog):
def sorttracknum(item):
try:
return int(item.tracknumber)
except:
except ValueError:
try:
# This allows to parse values like '3' but also '3/10'
m = re.search('^\d+', item.tracknumber)
return int(m.group(0))
except:
except AttributeError:
return 0
lines = ["%s %s - %s (%s)" % item for item in sorted(tracklist, key=sorttracknum)]