jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/226323 )
Change subject: [IMPROV] Link: Normalize before assert ......................................................................
[IMPROV] Link: Normalize before assert
Instead of checking all different variants in the assert, just normalize it first and then assert that the normalization worked.
Change-Id: I363959423614411f43a2c7e10a123b2b55e88a04 --- M pywikibot/page.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/page.py b/pywikibot/page.py index 73c030f..549fcff 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -4619,14 +4619,14 @@ """ source_is_page = isinstance(source, BasePage)
- assert source is None or source_is_page or isinstance(source, pywikibot.site.BaseSite), \ - "source parameter should be either a Site or Page object" - if source_is_page: self._source = source.site else: self._source = source or pywikibot.Site()
+ assert isinstance(self._source, pywikibot.site.BaseSite), \ + "source parameter should be either a Site or Page object" + self._text = text self._defaultns = defaultNamespace
pywikibot-commits@lists.wikimedia.org