In general, you should only catch the exceptions that you expect (probably AttributeError). But if you copied this, I'm fine with it. Maybe ask @medwards why it's a bare except.