Python: try...except with wildcard for exception names?
exception, python
Solution
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.
# Please note, the exception class truly is lower cased as indicated
mutagen.id3.error
mutagen.flac.error
mutagen.apev2.error
# mutagen.easyid3 errors extend the mutagen.id3.error class
Problem
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 :P