From 2cd1f0452eb746ae727218f5dbda0fd1ae0b2e34 Mon Sep 17 00:00:00 2001 From: Anthony King Date: Mon, 5 May 2014 21:24:05 +0100 Subject: [PATCH] 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 --- project.py | 6 +++--- subcmds/status.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/project.py b/project.py index 127176e5..897f4c90 100644 --- a/project.py +++ b/project.py @@ -2321,8 +2321,8 @@ class Project(object): out = iter(out[:-1].split('\0')) # pylint: disable=W1401 while out: try: - info = out.next() - path = out.next() + info = next(out) + path = next(out) except StopIteration: break @@ -2348,7 +2348,7 @@ class Project(object): info = _Info(path, *info) if info.status in ('R', 'C'): info.src_path = info.path - info.path = out.next() + info.path = next(out) r[info.path] = info return r finally: diff --git a/subcmds/status.py b/subcmds/status.py index 41c4429a..b42675e0 100644 --- a/subcmds/status.py +++ b/subcmds/status.py @@ -113,7 +113,7 @@ the following meanings: try: state = project.PrintWorkTreeStatus(output) if state == 'CLEAN': - clean_counter.next() + next(clean_counter) finally: sem.release() @@ -141,7 +141,7 @@ the following meanings: for project in all_projects: state = project.PrintWorkTreeStatus() if state == 'CLEAN': - counter.next() + next(counter) else: sem = _threading.Semaphore(opt.jobs) threads_and_output = [] @@ -164,7 +164,7 @@ the following meanings: t.join() output.dump(sys.stdout) output.close() - if len(all_projects) == counter.next(): + if len(all_projects) == next(counter): print('nothing to commit (working directory clean)') if opt.orphans: