python: Use range() instead of xrange()

Python 2 has a range() function which returns a list, and an xrange()
one which returns an iterator.

Python 3 lost the function returning a list, and renamed the function
returning an iterator as range().

As a result, using range() makes the scripts compatible with both Python
versions 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Mathieu Bridon
2018-07-06 12:22:18 +02:00
committed by Dylan Baker
parent 022d2a381d
commit 9ebd8372b9
9 changed files with 12 additions and 12 deletions

View File

@@ -116,7 +116,7 @@ constant_template_common = mako.template.Template("""\
constant_template_vector_scalar = mako.template.Template("""\
case ${op.get_enum_name()}:
% if "mixed" in op.flags:
% for i in xrange(op.num_operands):
% for i in range(op.num_operands):
assert(op[${i}]->type->base_type == ${op.source_types[0].glsl_type} ||
% for src_type in op.source_types[1:-1]:
op[${i}]->type->base_type == ${src_type.glsl_type} ||