From b99a6acc549d00cdb6968941889a26a2e69e9f8e Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Fri, 27 May 2016 01:07:56 -0400 Subject: [PATCH] use next() instead of iter.next() throughout --- beets/dbcore/db.py | 6 +++--- beets/util/pipeline.py | 8 ++++---- test/test_dbcore.py | 2 +- test/test_pipeline.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index ba67dd6d1..61906a08d 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -609,8 +609,8 @@ class Results(object): it = iter(self) try: for i in range(n): - it.next() - return it.next() + next(it) + return next(it) except StopIteration: raise IndexError(u'result index {0} out of range'.format(n)) @@ -620,7 +620,7 @@ class Results(object): """ it = iter(self) try: - return it.next() + return next(it) except StopIteration: return None diff --git a/beets/util/pipeline.py b/beets/util/pipeline.py index 9b134d1e7..bae06111c 100644 --- a/beets/util/pipeline.py +++ b/beets/util/pipeline.py @@ -248,7 +248,7 @@ class FirstPipelineThread(PipelineThread): # Get the value from the generator. try: - msg = self.coro.next() + msg = next(self.coro) except StopIteration: break @@ -281,7 +281,7 @@ class MiddlePipelineThread(PipelineThread): def run(self): try: # Prime the coroutine. - self.coro.next() + next(self.coro) while True: with self.abort_lock: @@ -326,7 +326,7 @@ class LastPipelineThread(PipelineThread): def run(self): # Prime the coroutine. - self.coro.next() + next(self.coro) try: while True: @@ -444,7 +444,7 @@ class Pipeline(object): # "Prime" the coroutines. for coro in coros[1:]: - coro.next() + next(coro) # Begin the pipeline. for out in coros[0]: diff --git a/test/test_dbcore.py b/test/test_dbcore.py index 0098dc375..0782fc26a 100644 --- a/test/test_dbcore.py +++ b/test/test_dbcore.py @@ -609,7 +609,7 @@ class ResultsIteratorTest(unittest.TestCase): results = self.db._fetch(TestModel1) it1 = iter(results) it2 = iter(results) - it1.next() + next(it1) list(it2) self.assertEqual(len(list(it1)), 1) diff --git a/test/test_pipeline.py b/test/test_pipeline.py index 2f5395fb5..2af10a336 100644 --- a/test/test_pipeline.py +++ b/test/test_pipeline.py @@ -133,7 +133,7 @@ class ExceptionTest(unittest.TestCase): pl = pipeline.Pipeline((_produce(), _exc_work())) pull = pl.pull() for i in range(3): - pull.next() + next(pull) self.assertRaises(TestException, pull.next)