diff --git a/mopidy/audio/playlists.py b/mopidy/audio/playlists.py index 35e0800d..37ef2569 100644 --- a/mopidy/audio/playlists.py +++ b/mopidy/audio/playlists.py @@ -76,7 +76,7 @@ def parse_pls(data): for section in cp.sections(): if section.lower() != 'playlist': continue - for i in xrange(cp.getint(section, 'numberofentries')): + for i in range(cp.getint(section, 'numberofentries')): yield cp.get(section, 'file%d' % (i+1)) diff --git a/mopidy/config/schemas.py b/mopidy/config/schemas.py index 12536c0c..3d997ffe 100644 --- a/mopidy/config/schemas.py +++ b/mopidy/config/schemas.py @@ -25,10 +25,10 @@ def _levenshtein(a, b): if n > m: return _levenshtein(b, a) - current = xrange(n + 1) - for i in xrange(1, m + 1): + current = range(n + 1) + for i in range(1, m + 1): previous, current = current, [i] + [0] * n - for j in xrange(1, n + 1): + for j in range(1, n + 1): add, delete = previous[j] + 1, current[j - 1] + 1 change = previous[j - 1] if a[j - 1] != b[i - 1]: diff --git a/tests/mpd/test_status.py b/tests/mpd/test_status.py index cd910340..6a455136 100644 --- a/tests/mpd/test_status.py +++ b/tests/mpd/test_status.py @@ -98,7 +98,8 @@ class StatusHandlerTest(unittest.TestCase): def test_status_method_contains_playlist(self): result = dict(status.status(self.context)) self.assertIn('playlist', result) - self.assertIn(int(result['playlist']), xrange(0, 2 ** 31 - 1)) + self.assertGreaterEqual(int(result['playlist']), 0) + self.assertLessEqual(int(result['playlist']), 2 ** 31 - 1) def test_status_method_contains_playlistlength(self): result = dict(status.status(self.context))