handler errors without 'type' set

This commit is contained in:
Damien Elmes 2009-06-02 03:20:28 +09:00
parent 619d2bcbaf
commit 470a501caa

View file

@ -621,7 +621,7 @@ new:
try: try:
self.deck = DeckStorage.Deck(deckPath) self.deck = DeckStorage.Deck(deckPath)
except Exception, e: except Exception, e:
if hasattr(e, 'data') and e.data['type'] == 'inuse': if hasattr(e, 'data') and e.data.get('type') == 'inuse':
if interactive: if interactive:
ui.utils.showInfo(_("Deck is already open.")) ui.utils.showInfo(_("Deck is already open."))
else: else: