diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-29 21:51:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-29 21:51:51 +0000 |
commit | 62ad189a65e5e3b4cb6c64c9ea2d493f2c06fffd (patch) | |
tree | 61426072aec2867df6492570e0522b471a3764c1 /py/obj.c | |
parent | 2d15c1216ddad8ee603106fd86ad36baf2d40ff8 (diff) | |
download | micropython-62ad189a65e5e3b4cb6c64c9ea2d493f2c06fffd.tar.gz micropython-62ad189a65e5e3b4cb6c64c9ea2d493f2c06fffd.zip |
py: Add compile option to enable/disable source line numbers.
Diffstat (limited to 'py/obj.c')
-rw-r--r-- | py/obj.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -57,7 +57,11 @@ void mp_obj_print_exception(mp_obj_t exc) { if (n > 0) { printf("Traceback (most recent call last):\n"); for (int i = n - 3; i >= 0; i -= 3) { +#if MICROPY_ENABLE_SOURCE_LINE printf(" File \"%s\", line %d, in %s\n", qstr_str(values[i]), (int)values[i + 1], qstr_str(values[i + 2])); +#else + printf(" File \"%s\", in %s\n", qstr_str(values[i]), qstr_str(values[i + 2])); +#endif } } } |