Skip to content

Commit 0be6359

Browse files
committed
py: When printf'ing an object as a pointer, pass the concrete pointer.
1 parent 2a1cca2 commit 0be6359

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

extmod/vfs_fat_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ typedef struct _pyb_file_obj_t {
7777

7878
STATIC void file_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
7979
(void)kind;
80-
mp_printf(print, "<io.%s %p>", mp_obj_get_type_str(self_in), self_in);
80+
mp_printf(print, "<io.%s %p>", mp_obj_get_type_str(self_in), MP_OBJ_TO_PTR(self_in));
8181
}
8282

8383
STATIC mp_uint_t file_obj_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) {

py/objtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ STATIC void instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_k
232232
}
233233

234234
// TODO: CPython prints fully-qualified type name
235-
mp_printf(print, "<%s object at %p>", mp_obj_get_type_str(self_in), self_in);
235+
mp_printf(print, "<%s object at %p>", mp_obj_get_type_str(self_in), self);
236236
}
237237

238238
mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self, size_t n_args, size_t n_kw, const mp_obj_t *args) {

0 commit comments

Comments
 (0)