circuitpython/tests/cpydiff/modules_json_nonserializabl...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
319 B
Python
Raw Normal View History

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