jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/771594 )
Change subject: [cleanup] Drop unused 'get_redirect' parameter in Page.getOldVersion ......................................................................
[cleanup] Drop unused 'get_redirect' parameter in Page.getOldVersion
'get_redirect' was never used in core. The compat implementation just raised an exception if the Page was a redirect but this is not very useful.
Change-Id: Ifa7905dee7214d515039b993e4b0c2fa15a4b78d --- M pywikibot/page/_basepage.py 1 file changed, 5 insertions(+), 8 deletions(-)
Approvals: Matěj Suchánek: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py index 05bc27b..94d9042 100644 --- a/pywikibot/page/_basepage.py +++ b/pywikibot/page/_basepage.py @@ -74,6 +74,7 @@ first_upper, is_ip_address, issue_deprecation_warning, + remove_last_args, )
@@ -480,19 +481,15 @@ self._getexception = IsRedirectPageError(self) raise self._getexception
- def getOldVersion(self, oldid, - force: bool = False, get_redirect: bool = False) -> str: - """ - Return text of an old revision of this page; same options as get(). + @remove_last_args(['get_redirect']) + def getOldVersion(self, oldid, force: bool = False) -> str: + """Return text of an old revision of this page.
:param oldid: The revid of the revision desired. """ if force or oldid not in self._revisions \ or self._revisions[oldid].text is None: - self.site.loadrevisions(self, - content=True, - revids=oldid) - # TODO: what about redirects, errors? + self.site.loadrevisions(self, content=True, revids=oldid) return self._revisions[oldid].text
def permalink(self, oldid=None, percent_encoded: bool = True,
pywikibot-commits@lists.wikimedia.org