aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2018-06-08 09:29:45 -0300
committerEduardo Habkost <ehabkost@redhat.com>2018-06-08 14:39:24 -0300
commitd24d523c14f5f519e04ea49bbe066323bb795879 (patch)
tree476a8452733a3d2d470361fb5c20b598c75b8fce /scripts
parent068cf7a44cd4d65c05aa877dbebced295be5ce44 (diff)
python: futurize -f libfuturize.fixes.fix_next_call
Change obj.next() calls to next(obj). This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_next_call $py Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20180608122952.2009-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ordereddict.py4
-rwxr-xr-xscripts/vmstate-static-checker.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/ordereddict.py b/scripts/ordereddict.py
index 2d1d81370b..68ed340b33 100644
--- a/scripts/ordereddict.py
+++ b/scripts/ordereddict.py
@@ -71,9 +71,9 @@ class OrderedDict(dict, DictMixin):
if not self:
raise KeyError('dictionary is empty')
if last:
- key = reversed(self).next()
+ key = next(reversed(self))
else:
- key = iter(self).next()
+ key = next(iter(self))
value = self.pop(key)
return key, value
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index 60d1bf4cda..d3467288dc 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -158,7 +158,7 @@ def check_fields(src_fields, dest_fields, desc, sec):
while True:
if advance_src:
try:
- s_item = s_iter.next()
+ s_item = next(s_iter)
except StopIteration:
if s_iter_list == []:
break
@@ -173,7 +173,7 @@ def check_fields(src_fields, dest_fields, desc, sec):
if advance_dest:
try:
- d_item = d_iter.next()
+ d_item = next(d_iter)
except StopIteration:
if d_iter_list == []:
# We were not in a substruct