diff --git a/mwclient/listing.py b/mwclient/listing.py index 656df704bb9ce83eb8d5b3c6349dbb7da76ab8ed..07ffd1700f385ab28d43d7b3d04393dbcd85d6b7 100644 --- a/mwclient/listing.py +++ b/mwclient/listing.py @@ -57,7 +57,7 @@ class List(object): if self.last: raise StopIteration self.load_chunk() - return List.next(self, full=full) + return List.__next__(self, full=full) def next(self, full=False): """ For Python 2.x support """ @@ -139,14 +139,18 @@ class GeneratorList(List): self.page_class = mwclient.page.Page - def next(self): - info = List.next(self, full=True) + def __next__(self): + info = List.__next__(self, full=True) if info['ns'] == 14: return Category(self.site, u'', info) if info['ns'] == 6: return mwclient.image.Image(self.site, u'', info) return mwclient.page.Page(self.site, u'', info) + def next(self): + """ For Python 2.x support """ + return self.__next__() + def load_chunk(self): # Put this here so that the constructor does not fail # on uninitialized sites