[Bf-blender-cvs] [87c08fa] master: Small speedup for blend_render_info.py
Dmitry Dygalo
noreply at git.blender.org
Tue Sep 20 12:40:27 CEST 2016
Commit: 87c08fa681f5c9f310abf928b7032992ac2a20b4
Author: Dmitry Dygalo
Date: Tue Sep 20 12:38:54 2016 +0200
Branches: master
https://developer.blender.org/rB87c08fa681f5c9f310abf928b7032992ac2a20b4
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
===================================================================
M release/scripts/modules/blend_render_info.py
===================================================================
diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py
index 5e4ee0e..30c3ed2 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':
More information about the Bf-blender-cvs
mailing list