jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/356432 )
Change subject: MWSite.__init__: Re-raise the RequestException of _parse_post_117
......................................................................
MWSite.__init__: Re-raise the RequestException of _parse_post_117
If there is any kind of RequestException in _parse_post_117, it means
that the `private_wiki` attribute has not had a chance to be set and
will definitly cause AttributeError later in the code.
Raising the RequestException is more clear and will allow the related
test to be skipped.
Bug: T160355
Change-Id: I75eb7c35a1e030a309bdf271a7ddc8ac69052ab9
---
M pywikibot/site_detect.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index d4bf878..347bd63 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -13,6 +13,8 @@
import json
import re
+from requests import RequestException
+
import pywikibot
from pywikibot.comms.http import fetch
@@ -82,7 +84,7 @@
if self.api:
try:
self._parse_post_117()
- except ServerError:
+ except (ServerError, RequestException):
raise
except Exception as e:
pywikibot.log('MW 1.17+ detection failed: {0!r}'.format(e))
--
To view, visit
https://gerrit.wikimedia.org/r/356432
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I75eb7c35a1e030a309bdf271a7ddc8ac69052ab9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>