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.

Change-Id: If30f3a870bf590fe9d1a8bb5af54cba67be012da
This commit is contained in:
vishal mahajan 2016-03-15 10:37:19 +05:30
parent 04b4737fbb
commit 46f9ba1706
1 changed files with 4 additions and 4 deletions

View File

@ -380,13 +380,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:
src = ''
if device != interface_name: