jenkins-bot has submitted this change and it was merged.
Change subject: Fix ItemPage.iterlinks when no family is given ......................................................................
Fix ItemPage.iterlinks when no family is given
In the old situation, the default family would be used (which is incorrect). In the new situation, links are not filtered by family unless explicitly given.
Change-Id: Idd19c9b0ef8d150d43848708d0f37cc28deeffde --- M pywikibot/page.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 4b99a31..077491f 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2599,11 +2599,11 @@ """ if not hasattr(self, 'sitelinks'): self.get() - if not isinstance(family, pywikibot.family.Family): + if family is not None and not isinstance(family, pywikibot.family.Family): family = pywikibot.site.Family(family) for dbname in self.sitelinks: pg = Page(pywikibot.site.APISite.fromDBName(dbname), self.sitelinks[dbname]) - if not family or family == pg.site.family: + if family is None or family == pg.site.family: yield pg
def getSitelink(self, site, force=False):