raise an exception when the file isn't a blend

This commit is contained in:
2014-11-19 16:27:11 +01:00
parent 0a2b4886c1
commit 49e3c1e181

View File

@@ -50,7 +50,7 @@ def open_blend(filename, access="rb"):
bfile.is_compressed = False
bfile.filepath_orig = filename
return bfile
else:
elif magic[:2] == b'\x1f\x8b':
log.debug("gzip blendfile detected?")
handle.close()
log.debug("decompressing started")
@@ -68,6 +68,8 @@ def open_blend(filename, access="rb"):
bfile.is_compressed = True
bfile.filepath_orig = filename
return bfile
else:
raise Exception("filetype not a blend or a gzip blend")
def align(offset, by):