From 87c08fa681f5c9f310abf928b7032992ac2a20b4 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Tue, 20 Sep 2016 12:38:54 +0200 Subject: 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 --- release/scripts/modules/blend_render_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py index 5e4ee0ee4b1..30c3ed2388b 100755 --- a/release/scripts/modules/blend_render_info.py +++ b/release/scripts/modules/blend_render_info.py @@ -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': -- cgit v1.2.3