Skip to content
Browse files

web.py: Handle newer versions of Requests library

  • Loading branch information...
1 parent c353d5a commit 45f38afeb87f7cef8b8c378da66337cb3a7c2e0c @srynot4sale committed Feb 18, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 web.py
View
7 web.py
@@ -161,7 +161,12 @@ def wrms_load(reporturl):
host = 'https://wrms.catalyst.net.nz/'
cookies = {'wrms3_auth': config.secret}
r = requests.get(host+reporturl, cookies=cookies)
- return r.json
+
+ try:
+ return r.json
+ except Exception:
+ import json
+ return json.loads(r.text)
def get_data():

0 comments on commit 45f38af

Please sign in to comment.
Something went wrong with that request. Please try again.