circuitpython/tests/cpydiff/modules_json_nonserializable.py
Scott Shawcroft b057fb8a4b
codeformat
2021-04-19 22:22:44 -07:00

16 lines
319 B
Python

"""
categories: Modules,json
description: JSON module does not throw exception when object is not serialisable
cause: Unknown
workaround: Unknown
"""
import json
a = bytes(x for x in range(256))
try:
z = json.dumps(a)
x = json.loads(z)
print("Should not get here")
except TypeError:
print("TypeError")