Python 3: load JSON as supported on 3.4 (and earlier)
Under Python 3.4, which runs on our CI and is our lowest supported
version, json.loads() requires a string, while newer versions also
allows bytes.
>>> json.loads(b'{}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/cleber/.local/lib/python3.4/json/__init__.py", line 312, in loads s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Let's make that code compatible with Python 3.4.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
想要评论请 注册 或 登录