mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-25 09:03:59 +00:00
Catch specific exceptions
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user