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
@@ -145,7 +145,7 @@ static const struct string_map_entry string_map_entries[] = {
|
||||
/* Hash table stats:
|
||||
* size ${len(strmap.sorted_strings)} entries
|
||||
* collisions entries:
|
||||
% for i in xrange(10):
|
||||
% for i in range(10):
|
||||
* ${i}${'+' if i == 9 else ' '} ${strmap.collisions[i]}
|
||||
% endfor
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user