jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1268232?usp=email )
Change subject: [bugfix] enable total parameter if '_langlinks' cache is given
......................................................................
[bugfix] enable total parameter if '_langlinks' cache is given
Bug: T422390
Change-Id: I7f7226b477b3ca70a57603cc2670e98df5a45040
---
M pywikibot/page/_basepage.py
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index b382bcc..50c8732 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -1635,11 +1635,9 @@
:return: A generator that yields Link objects.
"""
if hasattr(self, '_langlinks'):
- return iter(self.langlinks(include_obsolete=include_obsolete))
- # FIXME: We might want to fill _langlinks when the Site
- # method is called. If we do this, we'll have to think
- # about what will happen if the generator is not completely
- # iterated upon.
+ return islice(self.langlinks(include_obsolete=include_obsolete),
+ total)
+
return self.site.pagelanglinks(self, total=total,
include_obsolete=include_obsolete)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1268232?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7f7226b477b3ca70a57603cc2670e98df5a45040
Gerrit-Change-Number: 1268232
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]