jenkins-bot has submitted this change and it was merged.
Change subject: allpages.py: fix namespace param instance checking
......................................................................
allpages.py: fix namespace param instance checking
Namespace param can also be a Namespace object and not only an int.
Fixed also alllinks().
Bug: 73214
Change-Id: I306ad0933b5836c86bcd105a820a0fd8ca78358f
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index ba1b00c..cf80260 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3046,7 +3046,7 @@
(default False)
"""
- if not isinstance(namespace, int):
+ if not isinstance(namespace, (int, Namespace)):
raise Error("allpages: only one namespace permitted.")
if includeredirects is not None:
@@ -3115,7 +3115,7 @@
"""
if unique and fromids:
raise Error("alllinks: unique and fromids cannot both be True.")
- if not isinstance(namespace, int):
+ if not isinstance(namespace, (int, Namespace)):
raise Error("alllinks: only one namespace permitted.")
algen = self._generator(api.ListGenerator, type_arg="alllinks",
alnamespace=str(namespace), alfrom=start,
--
To view, visit https://gerrit.wikimedia.org/r/173113
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I306ad0933b5836c86bcd105a820a0fd8ca78358f
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits