Small speedup for blend_render_info.py

Do not close and re-open the file in case it's compressed, gzip module can now directly take a file object as parameter.

Differential Revision: https://developer.blender.org/D2235
This commit is contained in:
Dmitry Dygalo 2016-09-20 12:38:54 +02:00 committed by Bastien Montagne
parent 075a2175d5
commit 87c08fa681

@ -42,8 +42,8 @@ def read_blend_rend_chunk(path):
if head[0:2] == b'\x1f\x8b': # gzip magic
import gzip
blendfile.close()
blendfile = gzip.open(path, "rb")
blendfile.seek(0)
blendfile = gzip.open(blendfile, "rb")
head = blendfile.read(7)
if head != b'BLENDER':