summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-04 13:13:39 +0000
committerDamien George <damien.p.george@gmail.com>2016-01-04 13:13:39 +0000
commitd4df8f4925ae6e4875b521f1c35571f0b51e405a (patch)
tree3303cde75697e895767bbd77f2865c10322364fc /py
parent824f83fd201bcbabc4b07d2beb3000bdf33381a8 (diff)
downloadmicropython-d4df8f4925ae6e4875b521f1c35571f0b51e405a.tar.gz
micropython-d4df8f4925ae6e4875b521f1c35571f0b51e405a.zip
py/objstr: In str.format, handle case of no format spec for string arg.
Handles, eg, "{:>20}".format("foo"), where there is no explicit spec for the type of the argument.
Diffstat (limited to 'py')
-rw-r--r--py/objstr.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 8839acbf95..c4335bbac7 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -1259,10 +1259,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
}
switch (type) {
- case '\0':
- mp_obj_print_helper(&print, arg, PRINT_STR);
- break;
-
+ case '\0': // no explicit format type implies 's'
case 's': {
mp_uint_t slen;
const char *s = mp_obj_str_get_data(arg, &slen);