fix json loads
authorrobin
Thu, 17 Oct 2019 09:15:53 +0100
changeset 15 b6b247835014
parent 14 df46c58ec5c9
child 16 bba666ee6084
fix json loads
.hgignore
rl_ci_tools.py
--- a/.hgignore	Thu Oct 17 08:13:11 2019 +0100
+++ b/.hgignore	Thu Oct 17 09:15:53 2019 +0100
@@ -48,3 +48,4 @@
 ^[Ll]ib/
 ^bin/
 ^[tT]cl/
+^[iI]nclude/
--- a/rl_ci_tools.py	Thu Oct 17 08:13:11 2019 +0100
+++ b/rl_ci_tools.py	Thu Oct 17 09:15:53 2019 +0100
@@ -82,7 +82,7 @@
             print('!!!!!\n%r\n!!!!!'% b)
         if status_code!=200:
             raise ValueError('%s: request %r failed with status_code=%r!\n%r' % (PROG,url,status_code,b))
-        I = json.loads(b)
+        I = json.loads(b.decode('utf-8') if hasattr(b,'decode') else b)
         if verbosity>1:
             print('%s: %r --> %d rows' % (PROG, url, len(I)))
         return I