print a more informative keyerror
This commit is contained in:
parent
650bf8d62d
commit
ae18928064
2
nbt.py
2
nbt.py
@ -335,7 +335,7 @@ class TAG_Compound(TAG_Value, collections.MutableMapping):
|
||||
#if(len(hits)): return hits[0];
|
||||
for key in self.value:
|
||||
if key.name == k: return key
|
||||
raise KeyError("Key {0} not found".format(k));
|
||||
raise KeyError("Key {0} not found in tag {1}".format(k, self));
|
||||
|
||||
def __iter__(self): return itertools.imap(lambda x:x.name, self.value);
|
||||
def __contains__(self, k):return k in map(lambda x:x.name, self.value);
|
||||
|
Reference in New Issue
Block a user