jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] BasePage: Raise exception on redirect
......................................................................
[FIX] BasePage: Raise exception on redirect
The pageAPInfo method in compat does raises a NoPage and IsRedirectPage
when that applies to the page. The port in 7362b605 does raise NoPage
indirectly (as already exising methods handle that) but doesn't raise
IsRedirectPage (because a redirect page can have a latest revision).
Change-Id: Ifdd8f4bf1d0a635a998375119715cab6ffc1f8e1
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 6ff6d3a..357ec3f 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -430,6 +430,8 @@
@deprecated('latest_revision_id')
def pageAPInfo(self):
"""Return the current revision id for this
page."""
+ if self.isRedirectPage():
+ raise pywikibot.IsRedirectPage(self)
return self.latest_revision_id
@property
--
To view, visit
https://gerrit.wikimedia.org/r/202439
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdd8f4bf1d0a635a998375119715cab6ffc1f8e1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>