py3: use function next() instead of next() method on iterator objects
Python 3 introduced a next() function to replace the next() method on iterator objects. Ref: http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html#next TrivialFix Change-Id: Ic36d89dd5031a29744323df4e44d5b32d67c1b77
This commit is contained in:
parent
8b0d413b1c
commit
3fe3dfe6a1
|
@ -450,13 +450,13 @@ class IpRouteCommand(IpDeviceCommandBase):
|
|||
'match', subnet).split('\n')
|
||||
for subnet_route_line in subnet_route_list_lines:
|
||||
i = iter(subnet_route_line.split())
|
||||
while(i.next() != 'dev'):
|
||||
while(next(i) != 'dev'):
|
||||
pass
|
||||
device = i.next()
|
||||
device = next(i)
|
||||
try:
|
||||
while(i.next() != 'src'):
|
||||
while(next(i) != 'src'):
|
||||
pass
|
||||
src = i.next()
|
||||
src = next(i)
|
||||
except Exception:
|
||||
src = ''
|
||||
if device != interface_name:
|
||||
|
|
|
@ -29,7 +29,7 @@ class TackerBase(models.ModelBase):
|
|||
return self
|
||||
|
||||
def next(self):
|
||||
n = self._i.next().name
|
||||
n = next(self._i).name
|
||||
return n, getattr(self, n)
|
||||
|
||||
def __repr__(self):
|
||||
|
|
Loading…
Reference in New Issue