jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
[4.0] remove Python 2 codes from archived scripts

Change-Id: I59ec85b1aadb2d8e16963a578d48b78f24c155d0
---
M scripts/archive/cfd.py
M scripts/archive/featured.py
2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/scripts/archive/cfd.py b/scripts/archive/cfd.py
index 7257a48..85f0cd4 100755
--- a/scripts/archive/cfd.py
+++ b/scripts/archive/cfd.py
@@ -12,12 +12,10 @@

"""
#
-# (C) Pywikibot team, 2008-2019
+# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
-
import re
import sys

@@ -60,7 +58,7 @@
re.IGNORECASE)


-class ReCheck(object):
+class ReCheck:

"""Helper class."""

diff --git a/scripts/archive/featured.py b/scripts/archive/featured.py
index 2ab78c1..aa9a5b4 100755
--- a/scripts/archive/featured.py
+++ b/scripts/archive/featured.py
@@ -54,12 +54,10 @@

"""
#
-# (C) Pywikibot team, 2005-2019
+# (C) Pywikibot team, 2005-2020
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
-
import pickle
import re

@@ -69,20 +67,15 @@

from pywikibot.pagegenerators import PreloadingGenerator
from pywikibot.tools.formatter import color_format
-from pywikibot.tools import issue_deprecation_warning, PY2
-
-if not PY2:
- unichr = chr
+from pywikibot.tools import issue_deprecation_warning


def CAT(site, name, hide):
name = site.namespace(14) + ':' + name
cat = pywikibot.Category(site, name)
- for article in cat.articles(endsort=hide):
- yield article
+ yield from cat.articles(endsort=hide)
if hide:
- for article in cat.articles(startFrom=unichr(ord(hide) + 1)):
- yield article
+ yield from cat.articles(startFrom=chr(ord(hide) + 1))


def BACK(site, name, hide):
@@ -100,11 +93,9 @@
cat = pywikibot.Category(site, title)
if isinstance(hide, dict):
hide = hide.get(site.code)
- for article in cat.articles(endsort=hide):
- yield article
+ yield from cat.articles(endsort=hide)
if hide:
- for article in cat.articles(startsort=unichr(ord(hide) + 1)):
- yield article
+ yield from cat.articles(startsort=chr(ord(hide) + 1))


# not implemented yet
@@ -231,7 +222,7 @@
'interactive': False,
})

- super(FeaturedBot, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.cache = {}
self.filename = None
self.site = pywikibot.Site()

To view, visit change 617503. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I59ec85b1aadb2d8e16963a578d48b78f24c155d0
Gerrit-Change-Number: 617503
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged