aboutsummaryrefslogtreecommitdiff
path: root/stm
diff options
context:
space:
mode:
authorPaul Sokolovsky2014-01-13 19:19:16 +0200
committerPaul Sokolovsky2014-01-15 02:15:38 +0200
commit76d982ef343dcadd35355aed9c568984c850fb7b (patch)
tree1ded5f199ce740d3b72c00cc1e9c2b402936632f /stm
parent24224d7c72e1d6572ef0d24f08eb882dcac8dc50 (diff)
type->print(): Distinguish str() and repr() variety by passing extra param.
Diffstat (limited to 'stm')
-rw-r--r--stm/main.c10
-rw-r--r--stm/timer.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/stm/main.c b/stm/main.c
index ab8cced6a..a27c4e52f 100644
--- a/stm/main.c
+++ b/stm/main.c
@@ -436,7 +436,7 @@ void do_repl(void) {
}
} else {
// uncaught exception
- mp_obj_print((mp_obj_t)nlr.ret_val);
+ mp_obj_print((mp_obj_t)nlr.ret_val, PRINT_REPR);
printf("\n");
}
}
@@ -474,7 +474,7 @@ bool do_file(const char *filename) {
return true;
} else {
// uncaught exception
- mp_obj_print((mp_obj_t)nlr.ret_val);
+ mp_obj_print((mp_obj_t)nlr.ret_val, PRINT_REPR);
printf("\n");
return false;
}
@@ -656,7 +656,7 @@ typedef struct _pyb_file_obj_t {
FIL fp;
} pyb_file_obj_t;
-void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in) {
+void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
printf("<file %p>", self_in);
}
@@ -1097,13 +1097,13 @@ soft_reset:
if (nlr_push(&nlr) == 0) {
mp_obj_t ret = rt_call_function_0(module_fun);
printf("done! got: ");
- mp_obj_print(ret);
+ mp_obj_print(ret, PRINT_REPR);
printf("\n");
nlr_pop();
} else {
// uncaught exception
printf("exception: ");
- mp_obj_print((mp_obj_t)nlr.ret_val);
+ mp_obj_print((mp_obj_t)nlr.ret_val, PRINT_REPR);
printf("\n");
}
diff --git a/stm/timer.c b/stm/timer.c
index c665a461d..062f8c689 100644
--- a/stm/timer.c
+++ b/stm/timer.c
@@ -89,7 +89,7 @@ void timer_interrupt(void) {
} else {
// uncaught exception
printf("exception in timer interrupt\n");
- mp_obj_print((mp_obj_t)nlr.ret_val);
+ mp_obj_print((mp_obj_t)nlr.ret_val, PRINT_REPR);
printf("\n");
}
}