Yurik has submitted this change and it was merged.

Change subject: old requests lib workaround
......................................................................


old requests lib workaround

Change-Id: I532443ebab285495bb29f4fd7a2ab30a0ae72546
---
M scripts/api.py
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Yurik: Verified; Looks good to me, approved



diff --git a/scripts/api.py b/scripts/api.py
index 62ad555..79fbf53 100644
--- a/scripts/api.py
+++ b/scripts/api.py
@@ -127,7 +127,12 @@
             request_kw['params'] = kwargs
 
         result = self.request(method, forceSSL=forceSSL, **request_kw)
-        data = result.json(object_hook=AttrDict)
+
+        # Our servers still have requests 0.8.2 ... :(
+        if hasattr(result.__class__, 'json'):
+            data = result.json(object_hook=AttrDict)
+        else:
+            data = json.loads(result.content, object_hook=AttrDict)
 
         # Handle success and failure
         if 'error' in data:

-- 
To view, visit https://gerrit.wikimedia.org/r/154237
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I532443ebab285495bb29f4fd7a2ab30a0ae72546
Gerrit-PatchSet: 1
Gerrit-Project: analytics/zero-sms
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to