raise an exception when get/setting a value that doesn't exist

This commit is contained in:
2014-10-16 14:35:59 +02:00
parent 605d274406
commit b82aa439fa

View File

@@ -92,7 +92,7 @@ class BlendFile:
"header",
# struct.Struct
"block_header_struct",
# FileBlockHeader
# BlendFileBlock
"blocks",
# DNACatalog
"catalog",
@@ -509,7 +509,7 @@ class DNAStruct:
else:
offset += field[2]
return None
raise KeyError("%r not found in %r" % (path, [s[1].name_short for s in self.fields]))
def field_set(self, header, handle, path, value):
assert(type(path) == bytes)
@@ -533,7 +533,7 @@ class DNAStruct:
else:
offset += field[2]
return None
raise KeyError("%r not found in %r" % (path, [s[1].name_short for s in self.fields]))
class DNA_IO: