raise an exception when get/setting a value that doesn't exist
This commit is contained in:
@@ -92,7 +92,7 @@ class BlendFile:
|
|||||||
"header",
|
"header",
|
||||||
# struct.Struct
|
# struct.Struct
|
||||||
"block_header_struct",
|
"block_header_struct",
|
||||||
# FileBlockHeader
|
# BlendFileBlock
|
||||||
"blocks",
|
"blocks",
|
||||||
# DNACatalog
|
# DNACatalog
|
||||||
"catalog",
|
"catalog",
|
||||||
@@ -509,7 +509,7 @@ class DNAStruct:
|
|||||||
else:
|
else:
|
||||||
offset += field[2]
|
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):
|
def field_set(self, header, handle, path, value):
|
||||||
assert(type(path) == bytes)
|
assert(type(path) == bytes)
|
||||||
@@ -533,7 +533,7 @@ class DNAStruct:
|
|||||||
else:
|
else:
|
||||||
offset += field[2]
|
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:
|
class DNA_IO:
|
||||||
|
Reference in New Issue
Block a user