jenkins-bot has submitted this change and it was merged.
Change subject: revertbot.py: Don't compare match/None with int ......................................................................
revertbot.py: Don't compare match/None with int
It's not compatible with python 3. Bug: T140506
Change-Id: I3f6dca1ae5cb743b75687e85e02c38610faf396b --- M scripts/revertbot.py 1 file changed, 11 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/revertbot.py b/scripts/revertbot.py index 240720b..836ef5a 100755 --- a/scripts/revertbot.py +++ b/scripts/revertbot.py @@ -14,7 +14,7 @@ """ # # (C) Bryan Tong Minh, 2008 -# (C) Pywikibot team, 2008-2015 +# (C) Pywikibot team, 2008-2016 # # Ported by Geoffrey "GEOFBOT" Mon - User:Sn1per # for Google Code-In 2013 @@ -75,7 +75,7 @@ yield item
def revert_contribs(self, callback=None): - """Revert contrubutions.""" + """Revert contributions.""" if callback is None: callback = self.callback
@@ -94,7 +94,7 @@ return
def callback(self, item): - """Callback funktion.""" + """Callback function.""" return 'top' in item
def revert(self, item): @@ -146,12 +146,18 @@ """Example revert bot."""
def callback(self, item): - """Callback funktion for 'private' revert bot.""" + """Callback function for 'private' revert bot. + + @param item: an item from user contributions + @type item: dict + @rtype: bool + + """ if 'top' in item: page = pywikibot.Page(self.site, item['title']) text = page.get(get_redirect=True) pattern = re.compile(r'[[.+?:.+?..+?]]', re.UNICODE) - return pattern.search(text) >= 0 + return bool(pattern.search(text)) return False
pywikibot-commits@lists.wikimedia.org