summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/obj.c b/py/obj.c
index 76a4d8f9b2..ce555efa6d 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -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
}
}
}