Xqt has submitted this change and it was merged.
Change subject: Catching Nosuchsite exception while running page.interwiki() ......................................................................
Catching Nosuchsite exception while running page.interwiki()
Bug 55146
Change-Id: I8856569f5b59f0230e2a2b709d39fd9497d4247a --- M wikipedia.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/wikipedia.py b/wikipedia.py index c21c880..21955c0 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -2891,7 +2891,10 @@ data = datas['query']['pages'].values()[0] if "langlinks" in data: for c in data['langlinks']: - llpage = Page(getSite(c["lang"]), c["*"]) + try: + llpage = Page(getSite(c["lang"]), c["*"]) + except NoSuchSite: + continue iwlinks.append(llpage)
if 'query-continue' in datas: