mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
support get(x, default) in facts
This commit is contained in:
parent
fe6fb005b6
commit
0dc07bcfd1
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ class Fact(object):
|
|||
def get(self, key, default):
|
||||
try:
|
||||
return self[key]
|
||||
except IndexError:
|
||||
except (IndexError, KeyError):
|
||||
return default
|
||||
|
||||
def assertValid(self):
|
||||
|
|
Loading…
Reference in a new issue