• C
    Python 3: load JSON as supported on 3.4 (and earlier) · d2b4edc3
    Cleber Rosa 提交于
    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>
    d2b4edc3
test_basic.py 59.8 KB