jenkins-bot has submitted this change and it was merged.
Change subject: Fix old API version fetch
......................................................................
Fix old API version fetch
d51b9977 replaced urllib2 with requests, introducing an exception
in the old version detection as it attempted to load json from
a file handle, but the file handle was changed to a decoded string.
Also filter is not subscriptable on Python 3.
Change-Id: I141d77183b63c6d6d417689eb61ea5e40df4fc55
---
M pywikibot/site_detect.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index fed1f56..13bfe27 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -85,11 +85,11 @@
if self.version is None:
# try to get version using api
try:
- d = json.load(fetch(self.api + '?version&format=json').content)
- self.version = filter(
+ d = json.loads(fetch(self.api +
'?version&format=json').content)
+ self.version = list(filter(
lambda x: x.startswith("MediaWiki"),
[l.strip()
- for l in d['error']['*'].split("\n")])[0].split()[1]
+ for l in d['error']['*'].split("\n")]))[0].split()[1]
except Exception:
pass
--
To view, visit https://gerrit.wikimedia.org/r/235376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I141d77183b63c6d6d417689eb61ea5e40df4fc55
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits