Files
TencentOS-tiny/components/language/micropython/tests/cpydiff/modules_json_nonserializable.py
2022-09-29 12:10:37 +08: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")