Fix leaking file object when loading non-blend file
This commit is contained in:
@@ -94,6 +94,7 @@ class BlendFile:
|
||||
fileobj.close()
|
||||
self.fileobj = tmpfile
|
||||
elif magic != BLENDFILE_MAGIC:
|
||||
fileobj.close()
|
||||
raise exceptions.BlendFileError("File is not a blend file", path)
|
||||
|
||||
self.header = header.BlendFileHeader(self.fileobj, self.raw_filepath)
|
||||
|
||||
Reference in New Issue
Block a user