summaryrefslogtreecommitdiffstatshomepage
path: root/tests/cpydiff/modules_json_nonserializable.py
blob: 913b734e8bd2626fb9be8c2cdfe9b33453cc6a17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""
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')