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:

committed by
Dylan Baker

parent
022d2a381d
commit
9ebd8372b9
@@ -392,7 +392,7 @@ static const struct proc_pair
|
||||
_glapi_proc proc;
|
||||
} proc_pairs[%d] = {""" % len(procs))
|
||||
names = sorted(procs.keys())
|
||||
for i in xrange(len(names)):
|
||||
for i in range(len(names)):
|
||||
comma = ',' if i < len(names) - 1 else ''
|
||||
print(' { "%s", (_glapi_proc) gl%s }%s' % (names[i], procs[names[i]], comma))
|
||||
print("""};
|
||||
|
Reference in New Issue
Block a user