Commit 169b1a40 authored by Claude Paroz's avatar Claude Paroz
Browse files

Replaced foo.next() by next(foo).

This new syntax for next() has been introduced in Python 2.6 and is
compatible with Python 3.
parent 1c1a2296
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ class AdminForm(object):
        except (KeyError, IndexError):
            pass
        try:
            return iter(self.form).next()
            return next(iter(self.form))
        except StopIteration:
            return None

+3 −3
Original line number Diff line number Diff line
@@ -46,9 +46,9 @@ class Point(GEOSGeometry):

        cs = capi.create_cs(c_uint(1), c_uint(ndim))
        i = iter(coords)
        capi.cs_setx(cs, 0, i.next())
        capi.cs_sety(cs, 0, i.next())
        if ndim == 3: capi.cs_setz(cs, 0, i.next())
        capi.cs_setx(cs, 0, next(i))
        capi.cs_sety(cs, 0, next(i))
        if ndim == 3: capi.cs_setz(cs, 0, next(i))

        return capi.create_point(cs)

+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class ROCIFField(RegexField):
        key_iter = iter(key)
        checksum = 0
        for digit in value[1:]:
            checksum += int(digit) * int(key_iter.next())
            checksum += int(digit) * int(next(key_iter))
        checksum = checksum * 10 % 11
        if checksum == 10:
            checksum = 0
@@ -79,7 +79,7 @@ class ROCNPField(RegexField):
        checksum = 0
        value_iter = iter(value)
        for digit in key:
            checksum += int(digit) * int(value_iter.next())
            checksum += int(digit) * int(next(value_iter))
        checksum %= 11
        if checksum == 10:
            checksum = 1
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class Storage(object):
        count = itertools.count(1)
        while self.exists(name):
            # file_ext includes the dot.
            name = os.path.join(dir_name, "%s_%s%s" % (file_root, count.next(), file_ext))
            name = os.path.join(dir_name, "%s_%s%s" % (file_root, next(count), file_ext))

        return name

+1 −1
Original line number Diff line number Diff line
@@ -754,7 +754,7 @@ class CursorIterator(object):
        return self

    def next(self):
        return _rowfactory(self.iter.next(), self.cursor)
        return _rowfactory(next(self.iter), self.cursor)


def _rowfactory(row, cursor):
Loading