raise an exception when the file isn't a blend
This commit is contained in:
@@ -50,7 +50,7 @@ def open_blend(filename, access="rb"):
|
|||||||
bfile.is_compressed = False
|
bfile.is_compressed = False
|
||||||
bfile.filepath_orig = filename
|
bfile.filepath_orig = filename
|
||||||
return bfile
|
return bfile
|
||||||
else:
|
elif magic[:2] == b'\x1f\x8b':
|
||||||
log.debug("gzip blendfile detected?")
|
log.debug("gzip blendfile detected?")
|
||||||
handle.close()
|
handle.close()
|
||||||
log.debug("decompressing started")
|
log.debug("decompressing started")
|
||||||
@@ -68,6 +68,8 @@ def open_blend(filename, access="rb"):
|
|||||||
bfile.is_compressed = True
|
bfile.is_compressed = True
|
||||||
bfile.filepath_orig = filename
|
bfile.filepath_orig = filename
|
||||||
return bfile
|
return bfile
|
||||||
|
else:
|
||||||
|
raise Exception("filetype not a blend or a gzip blend")
|
||||||
|
|
||||||
|
|
||||||
def align(offset, by):
|
def align(offset, by):
|
||||||
|
Reference in New Issue
Block a user