Implemented/fixed/ported loading of blend files and getting blocks & props

This commit is contained in:
Sybren A. Stüvel
2018-02-22 15:52:10 +01:00
parent e66b1edaf4
commit 9c7791f762
6 changed files with 93 additions and 38 deletions
+4 -1
View File
@@ -17,7 +17,10 @@ class EndianIO:
@classmethod
def _read(cls, fileobj: typing.BinaryIO, typestruct: struct.Struct):
data = fileobj.read(typestruct.size)
return typestruct.unpack(data)[0]
try:
return typestruct.unpack(data)[0]
except struct.error as ex:
raise struct.error('%s (read %d bytes)' % (ex, len(data))) from None
@classmethod
def read_char(cls, fileobj: typing.BinaryIO):