JSON serializer for objects not serializable by default json code
(obj)
| 10 | |
| 11 | |
| 12 | def json_serial(obj): |
| 13 | """JSON serializer for objects not serializable by default json code""" |
| 14 | |
| 15 | if isinstance(obj, (datetime.datetime,)): |
| 16 | return obj.isoformat() |
| 17 | raise TypeError("Type %s not serializable" % type(obj)) |
| 18 | |
| 19 | |
| 20 | # Modified version of lm_dataformat Archive for single file. |
nothing calls this directly
no outgoing calls
no test coverage detected