jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/378877 )
Change subject: Fix behavior when treat_missing_item is None
......................................................................
Fix behavior when treat_missing_item is None
When is_item is False, we should obviously try to
load the page's item if it has one.
Change-Id: I510830ff85d747dd370dc9f69c62d3e0dfdfd5e3
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 3444389..03e22e8 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -2130,7 +2130,10 @@
item = pywikibot.ItemPage(data_site, page.title())
page = None
else:
- item = None
+ try:
+ item = pywikibot.ItemPage.fromPage(page)
+ except pywikibot.NoPage:
+ item = None
if self.use_from_page is False:
pywikibot.error('{0} is not in the item namespace but '
'must be an item.'.format(page))
--
To view, visit https://gerrit.wikimedia.org/r/378877
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I510830ff85d747dd370dc9f69c62d3e0dfdfd5e3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Magul <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits