I want to except only exceptions thrown by mutagen. However, there’s a LOT of possible exceptions there. Is there some way I can wildcard (via regexp/etc) the exceptions handled by except? The alternative is just fugly…
mutagen.apev2.APEBadItemError
mutagen.apev2.APENoHeaderError
mutagen.apev2.KeyError
mutagen.apev2.ValueError
mutagen.easyid3.EasyID3KeyError
mutagen.easyid3.KeyError
mutagen.easyid3.ValueError
mutagen.flac.FLACNoHeaderError
mutagen.flac.FLACVorbisError
mutagen.flac.TypeError
mutagen.id3.EnvironmentError
mutagen.id3.EOFError
mutagen.id3.ID3BadCompressedData
mutagen.id3.ID3BadUnsynchData
and so on 😛
There’s a less fugly way of going it, although it’s still a slight pain, each of those modules implements an “error” that all of the relevant errors extend from.