summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-13 19:19:16 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-15 02:15:38 +0200
commit76d982ef343dcadd35355aed9c568984c850fb7b (patch)
tree1ded5f199ce740d3b72c00cc1e9c2b402936632f /unix
parent24224d7c72e1d6572ef0d24f08eb882dcac8dc50 (diff)
downloadmicropython-76d982ef343dcadd35355aed9c568984c850fb7b.tar.gz
micropython-76d982ef343dcadd35355aed9c568984c850fb7b.zip
type->print(): Distinguish str() and repr() variety by passing extra param.
Diffstat (limited to 'unix')
-rw-r--r--unix/file.c2
-rw-r--r--unix/main.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/unix/file.c b/unix/file.c
index 204dc1b7ef..eef3378d80 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -15,7 +15,7 @@ typedef struct _mp_obj_fdfile_t {
int fd;
} mp_obj_fdfile_t;
-static void fdfile_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in) {
+static void fdfile_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
mp_obj_fdfile_t *self = self_in;
print(env, "<io.FileIO %d>", self->fd);
}
diff --git a/unix/main.c b/unix/main.c
index 15a4000ab5..e96ee28464 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -63,7 +63,7 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind
nlr_pop();
} 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");
}
}
@@ -159,7 +159,7 @@ typedef struct _test_obj_t {
int value;
} test_obj_t;
-static void test_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in) {
+static void test_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
test_obj_t *self = self_in;
print(env, "<test %d>", self->value);
}