diff options
author | Damien George <damien.p.george@gmail.com> | 2018-07-08 23:13:37 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-07-08 23:13:37 +1000 |
commit | b2b06450e314f776d66dc8985cf61a0d76f7a2ae (patch) | |
tree | a3299105a499022eab4247986febbb0881fcd0a0 /lib/utils/pyexec.c | |
parent | 4cd853fbd286703a7eb3fb5a453e112e4712f622 (diff) | |
download | micropython-b2b06450e314f776d66dc8985cf61a0d76f7a2ae.tar.gz micropython-b2b06450e314f776d66dc8985cf61a0d76f7a2ae.zip |
lib/utils: Fix to support compiling with object representation D.
Diffstat (limited to 'lib/utils/pyexec.c')
-rw-r--r-- | lib/utils/pyexec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 0522de7973..5d72419d1a 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -114,11 +114,11 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input mp_hal_stdout_tx_strn("\x04", 1); } // check for SystemExit - if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_SystemExit)) { + if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(((mp_obj_base_t*)nlr.ret_val)->type), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) { // at the moment, the value of SystemExit is unused ret = pyexec_system_exit; } else { - mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); + mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val)); ret = 0; } } @@ -131,8 +131,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input { size_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes; qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes); - printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n " - "n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", + printf("qstr:\n n_pool=%u\n n_qstr=%u\n " + "n_str_data_bytes=%u\n n_total_bytes=%u\n", (unsigned)n_pool, (unsigned)n_qstr, (unsigned)n_str_data_bytes, (unsigned)n_total_bytes); } |