summaryrefslogtreecommitdiff
path: root/py/objnone.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-17 22:56:34 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-17 22:56:34 +0100
commit612045f53f7e5edf9faa359ee9ee52d490d58000 (patch)
treea021612e31ff6275246514405c4a8421c6eff5d7 /py/objnone.c
parent8a9b999f1c9a0edf84b2507940efb8deaaa380b8 (diff)
py: Add native json printing using existing print framework.
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
Diffstat (limited to 'py/objnone.c')
-rw-r--r--py/objnone.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/objnone.c b/py/objnone.c
index a8d607143..01536dcb3 100644
--- a/py/objnone.c
+++ b/py/objnone.c
@@ -38,7 +38,11 @@ typedef struct _mp_obj_none_t {
} mp_obj_none_t;
STATIC void none_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
- print(env, "None");
+ if (MICROPY_PY_UJSON && kind == PRINT_JSON) {
+ print(env, "null");
+ } else {
+ print(env, "None");
+ }
}
STATIC mp_obj_t none_unary_op(mp_uint_t op, mp_obj_t o_in) {