Changeset 601


Ignore:
Timestamp:
Nov 22, 2015, 9:16:50 AM (4 years ago)
Author:
cito
Message:

Python 3 changed the iterator protocol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/pgdb.py

    r600 r601  
    406406            for args in zip(coltypes, row)]) for row in result]
    407407
    408     def next(self):
     408    def __next__(self):
    409409        """Return the next row (support for the iteration protocol)."""
    410410        res = self.fetchone()
     
    412412            raise StopIteration
    413413        return res
     414
     415    # Note that since Python 2.6 the iterator protocol uses __next()__
     416    # instead of next(), we keep it only for backward compatibility of pgdb.
     417    next = __next__
    414418
    415419    @staticmethod
Note: See TracChangeset for help on using the changeset viewer.