jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/342484 )
Change subject: Clean up obsolete code in cosmetic_changes.py ......................................................................
Clean up obsolete code in cosmetic_changes.py
The exception handling is done in CurrentPageBot._save_page().
Change-Id: I082f49c7df2edf8910722910cca20ca486e575fe --- M scripts/cosmetic_changes.py 1 file changed, 8 insertions(+), 15 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index def3673..1fc260f 100644 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -27,7 +27,7 @@ """ # # (C) xqt, 2009-2013 -# (C) Pywikibot team, 2006-2015 +# (C) Pywikibot team, 2006-2017 # # Distributed under the terms of the MIT license. # @@ -71,20 +71,13 @@
def treat_page(self): """Treat page with the cosmetic toolkit.""" - try: - ccToolkit = cosmetic_changes.CosmeticChangesToolkit.from_page( - self.current_page, False, self.getOption('ignore')) - changedText = ccToolkit.change(self.current_page.get()) - if changedText is not False: - self.put_current(new_text=changedText, - summary=self.getOption('summary'), - async=self.getOption('async')) - except pywikibot.LockedPage: - pywikibot.output("Page %s is locked?!" - % self.current_page.title(asLink=True)) - except pywikibot.EditConflict: - pywikibot.output("An edit conflict has occurred at %s." - % self.current_page.title(asLink=True)) + ccToolkit = cosmetic_changes.CosmeticChangesToolkit.from_page( + self.current_page, False, self.getOption('ignore')) + changedText = ccToolkit.change(self.current_page.get()) + if changedText is not False: + self.put_current(new_text=changedText, + summary=self.getOption('summary'), + async=self.getOption('async'))
def main(*args):
pywikibot-commits@lists.wikimedia.org