Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
81e70a88
Commit
81e70a88
authored
Jan 28, 2015
by
Damien George
Browse files
py: Make REPL printing function print repr of object, not str.
Addresses issue #1014.
parent
0d3cb672
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/modbuiltins.c
View file @
81e70a88
...
...
@@ -442,7 +442,17 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_print_obj, 0, mp_builtin_print);
STATIC
mp_obj_t
mp_builtin___repl_print__
(
mp_obj_t
o
)
{
if
(
o
!=
mp_const_none
)
{
mp_builtin_print
(
1
,
&
o
,
(
mp_map_t
*
)
&
mp_const_empty_map
);
#if MICROPY_PY_IO
extern
mp_uint_t
mp_sys_stdout_obj
;
// type is irrelevant, just need pointer
pfenv_t
pfenv
;
pfenv
.
data
=
&
mp_sys_stdout_obj
;
pfenv
.
print_strn
=
(
void
(
*
)(
void
*
,
const
char
*
,
mp_uint_t
))
mp_stream_write
;
mp_obj_print_helper
((
void
(
*
)(
void
*
env
,
const
char
*
fmt
,
...))
pfenv_printf
,
&
pfenv
,
o
,
PRINT_REPR
);
mp_stream_write
(
&
mp_sys_stdout_obj
,
"
\n
"
,
1
);
#else
mp_obj_print
(
o
,
PRINT_REPR
);
printf
(
"
\n
"
);
#endif
}
return
mp_const_none
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment