Matěj Suchánek has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/362232 )
Change subject: [IMPR] Only report to the user if the page doesn't exist
......................................................................
[IMPR] Only report to the user if the page doesn't exist
The exception is thrown if the page doesn't exist, or if
does but isn't connected to an item.
Bug: T168575
Change-Id: Ib143eddb5be2c32e6625bd4ad6d3efd6028661ff
---
M scripts/interwikidata.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/32/362232/1
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index f4c23d5..b549518 100644
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -159,8 +159,9 @@
try:
wd_data.add(pywikibot.ItemPage.fromPage(iw_page))
except pywikibot.NoPage:
- warning('Interwiki %s does not exist, skipping...' %
- iw_page.title(asLink=True))
+ if not iw_page.exists():
+ warning('Interwiki %s does not exist, skipping...' %
+ iw_page.title(asLink=True))
continue
if not wd_data:
# will create a new item with interwiki
--
To view, visit https://gerrit.wikimedia.org/r/362232
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib143eddb5be2c32e6625bd4ad6d3efd6028661ff
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits