mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Modernize use of range()
In Python 3, range() behaves like the old xrange(). The difference between range() and xrange() is usually not significant, especially if the whole result is iterated over. Convert xrange() usage to range() for small ranges. Use modern idioms in a few other uses of range(). Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
9e917cae39
commit
5178e9a597
@@ -33,8 +33,8 @@ def entry_to_update(entry):
|
||||
update = []
|
||||
for attr in entry.keys():
|
||||
if isinstance(entry[attr], list):
|
||||
for i in xrange(len(entry[attr])):
|
||||
update.append(dict(attr=str(attr), value=str(entry[attr][i])))
|
||||
for item in entry[attr]:
|
||||
update.append(dict(attr=str(attr), value=str(item)))
|
||||
else:
|
||||
update.append(dict(attr=str(attr), value=str(entry[attr])))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user