mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Use next(iterator) rather than iterator.next()
iterator.next() was replaced with iterator.__next__() in Python 3. Use next(iterator) instead which will select the correct method for returning the next item. Change-Id: I6d0c89c8b32e817e5897fe87332933dacf22027b
This commit is contained in:
parent
65e3a78a9e
commit
2cd1f0452e
@ -2321,8 +2321,8 @@ class Project(object):
|
|||||||
out = iter(out[:-1].split('\0')) # pylint: disable=W1401
|
out = iter(out[:-1].split('\0')) # pylint: disable=W1401
|
||||||
while out:
|
while out:
|
||||||
try:
|
try:
|
||||||
info = out.next()
|
info = next(out)
|
||||||
path = out.next()
|
path = next(out)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -2348,7 +2348,7 @@ class Project(object):
|
|||||||
info = _Info(path, *info)
|
info = _Info(path, *info)
|
||||||
if info.status in ('R', 'C'):
|
if info.status in ('R', 'C'):
|
||||||
info.src_path = info.path
|
info.src_path = info.path
|
||||||
info.path = out.next()
|
info.path = next(out)
|
||||||
r[info.path] = info
|
r[info.path] = info
|
||||||
return r
|
return r
|
||||||
finally:
|
finally:
|
||||||
|
@ -113,7 +113,7 @@ the following meanings:
|
|||||||
try:
|
try:
|
||||||
state = project.PrintWorkTreeStatus(output)
|
state = project.PrintWorkTreeStatus(output)
|
||||||
if state == 'CLEAN':
|
if state == 'CLEAN':
|
||||||
clean_counter.next()
|
next(clean_counter)
|
||||||
finally:
|
finally:
|
||||||
sem.release()
|
sem.release()
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ the following meanings:
|
|||||||
for project in all_projects:
|
for project in all_projects:
|
||||||
state = project.PrintWorkTreeStatus()
|
state = project.PrintWorkTreeStatus()
|
||||||
if state == 'CLEAN':
|
if state == 'CLEAN':
|
||||||
counter.next()
|
next(counter)
|
||||||
else:
|
else:
|
||||||
sem = _threading.Semaphore(opt.jobs)
|
sem = _threading.Semaphore(opt.jobs)
|
||||||
threads_and_output = []
|
threads_and_output = []
|
||||||
@ -164,7 +164,7 @@ the following meanings:
|
|||||||
t.join()
|
t.join()
|
||||||
output.dump(sys.stdout)
|
output.dump(sys.stdout)
|
||||||
output.close()
|
output.close()
|
||||||
if len(all_projects) == counter.next():
|
if len(all_projects) == next(counter):
|
||||||
print('nothing to commit (working directory clean)')
|
print('nothing to commit (working directory clean)')
|
||||||
|
|
||||||
if opt.orphans:
|
if opt.orphans:
|
||||||
|
Loading…
Reference in New Issue
Block a user