jenkins-bot has submitted this change and it was merged.
Change subject: Bug 58053 - next(it) instead of it.next() ......................................................................
Bug 58053 - next(it) instead of it.next()
Change-Id: If30ea7c6e5174ab2dc2edfc965c3f0bcdbff2e5c --- M scripts/commonscat.py M scripts/data_ingestion.py M scripts/interwiki.py M scripts/reflinks.py M scripts/tests/test_data_ingestion.py M tests/site_tests.py 6 files changed, 6 insertions(+), 6 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/commonscat.py b/scripts/commonscat.py index e03d7cd..e523656 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -509,7 +509,7 @@ pywikibot.output(u'Commons category does not exist. Examining deletion log...') logpages = commonsSite.logevents(logtype='delete', page=commonsPage) for logitem in logpages: - logitem = logpages.next() + logitem = next(logpages) (logpage, loguser, logtimestamp, logcomment) = logitem # Some logic to extract the target page. regex = u'moved to [[:?Category:(?P<newcat1>[^|}]+)(|[^}]+)?]]|Robot: Changing Category:(.+) to Category:(?P<newcat2>.+)' diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py index 38d5246..c6e2636 100755 --- a/scripts/data_ingestion.py +++ b/scripts/data_ingestion.py @@ -134,7 +134,7 @@ return title
def doSingle(self): - return self._doUpload(self.reader.next()) + return self._doUpload(next(self.reader))
def run(self): for photo in self.reader: diff --git a/scripts/interwiki.py b/scripts/interwiki.py index 7d5f8a5..90a0e84 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -2151,7 +2151,7 @@ try: while True: try: - page = self.pageGenerator.next() + page = next(self.pageGenerator) except IOError: pywikibot.output(u'IOError occured; skipping') continue diff --git a/scripts/reflinks.py b/scripts/reflinks.py index ed7466c..cfc16f2 100644 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -193,7 +193,7 @@ def next(self): while True: try: - entry = self.parser.next() + entry = next(self.parser) except StopIteration: raise if self.skipping: diff --git a/scripts/tests/test_data_ingestion.py b/scripts/tests/test_data_ingestion.py index dac3974..8cee9de 100644 --- a/scripts/tests/test_data_ingestion.py +++ b/scripts/tests/test_data_ingestion.py @@ -51,7 +51,7 @@ def setUp(self): fileobj = open(os.path.join(os.path.split(__file__)[0], 'data', 'csv_ingestion.csv')) self.iterator = data_ingestion.CSVReader(fileobj, 'url') - self.obj = self.iterator.next() + self.obj = next(self.iterator)
def test_PhotoURL(self): self.assertEqual(self.obj.URL, 'http://upload.wikimedia.org/wikipedia/commons/f/fc/MP_sounds.png') diff --git a/tests/site_tests.py b/tests/site_tests.py index b17b274..b37ecee 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -30,7 +30,7 @@ global mysite, mainpage, imagepage mysite = pywikibot.Site(cls.code, cls.family) mainpage = pywikibot.Page(pywikibot.Link("Main Page", mysite)) - imagepage = iter(mainpage.imagelinks()).next() # 1st image on main page + imagepage = next(iter(mainpage.imagelinks())) # 1st image on main page
def testBaseMethods(self): """Test cases for BaseSite methods"""