jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/642169 )
Change subject: [IMPR] Replaced PageNotSaved by PageSaveRelatedError ......................................................................
[IMPR] Replaced PageNotSaved by PageSaveRelatedError
Bug: T267821 Change-Id: Ie38f0b3bac7c87e93d6f5c43c061f48e623e92ad --- M scripts/archive/featured.py M scripts/newitem.py M scripts/solve_disambiguation.py M scripts/touch.py M tests/edit_failure_tests.py 5 files changed, 7 insertions(+), 7 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/archive/featured.py b/scripts/archive/featured.py index aa9a5b4..19fdd0d 100755 --- a/scripts/archive/featured.py +++ b/scripts/archive/featured.py @@ -593,7 +593,7 @@ except pywikibot.LockedPage: pywikibot.output('Page %s is locked!' % dest.title()) - except pywikibot.PageNotSaved: + except pywikibot.PageSaveRelatedError: pywikibot.output('Page not saved')
diff --git a/scripts/newitem.py b/scripts/newitem.py index bf30f83..6db06a7 100755 --- a/scripts/newitem.py +++ b/scripts/newitem.py @@ -32,7 +32,7 @@ from pywikibot import pagegenerators from pywikibot.bot import NoRedirectPageBot, WikidataBot from pywikibot.exceptions import (LockedPage, NoCreateError, NoPage, - PageNotSaved) + PageSaveRelatedError) from pywikibot.tools import PYTHON_VERSION
if PYTHON_VERSION >= (3, 9): @@ -92,7 +92,7 @@ except LockedPage: pywikibot.error('Page {0} is locked.'.format( page.title(as_link=True))) - except PageNotSaved: + except PageSaveRelatedError: pywikibot.error('Page {0} not saved.'.format( page.title(as_link=True)))
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index 18bb871..fa6b8ff 100755 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -786,7 +786,7 @@ try: refPage.put(redir_text, summary=self.comment, asynchronous=True) - except pywikibot.PageNotSaved as error: + except pywikibot.PageSaveRelatedError as error: pywikibot.output('Page not saved: {0}' .format(error.args)) else: @@ -1031,7 +1031,7 @@ refPage.put(text, summary=self.comment, asynchronous=True) except pywikibot.LockedPage: pywikibot.output('Page not saved: page is locked') - except pywikibot.PageNotSaved as error: + except pywikibot.PageSaveRelatedError as error: pywikibot.output('Page not saved: {0}'.format(error.args))
return 'done' diff --git a/scripts/touch.py b/scripts/touch.py index 0a1c9f7..fa02796 100755 --- a/scripts/touch.py +++ b/scripts/touch.py @@ -58,7 +58,7 @@ except pywikibot.LockedPage: pywikibot.error('Page {0} is locked.' .format(page.title(as_link=True))) - except pywikibot.PageNotSaved: + except pywikibot.PageSaveRelatedError: pywikibot.error('Page {0} not saved.' .format(page.title(as_link=True)))
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py index ae23030..b82ddcf 100644 --- a/tests/edit_failure_tests.py +++ b/tests/edit_failure_tests.py @@ -138,7 +138,7 @@ """Test ItemPage save method inherited from superclass Page.""" repo = self.get_repo() item = pywikibot.ItemPage(repo, 'Q6') - self.assertRaises(pywikibot.PageNotSaved, item.save) + self.assertRaises(pywikibot.PageSaveRelatedError, item.save)
def _make_WbMonolingualText_claim(self, repo, text, language): """Make a WbMonolingualText and set its value."""
pywikibot-commits@lists.wikimedia.org