aboutsummaryrefslogtreecommitdiff
path: root/extmod/modujson.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/modujson.c')
-rw-r--r--extmod/modujson.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/extmod/modujson.c b/extmod/modujson.c
index f731d7193..830b588fd 100644
--- a/extmod/modujson.c
+++ b/extmod/modujson.c
@@ -35,9 +35,7 @@
#if MICROPY_PY_UJSON
STATIC mp_obj_t mod_ujson_dump(mp_obj_t obj, mp_obj_t stream) {
- if (!MP_OBJ_IS_OBJ(stream)) {
- mp_raise_TypeError(NULL);
- }
+ mp_get_stream_raise(stream, MP_STREAM_OP_WRITE);
mp_print_t print = {MP_OBJ_TO_PTR(stream), mp_stream_write_adaptor};
mp_obj_print_helper(&print, obj, PRINT_JSON);
return mp_const_none;