aboutsummaryrefslogtreecommitdiff
path: root/py/objstr.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2022-01-10 09:03:27 -0600
committerDamien George <damien@micropython.org>2022-01-19 15:34:32 +1100
commit037b2c72a1d5b54a5508a58ab2044628a7a39fa4 (patch)
tree5f1b8ea184099bf576e76ace8a5d61f52bbb6988 /py/objstr.c
parent5e506567a390db1b1d2df39ae192f39ed9f617c3 (diff)
py/objstr: Support '{:08}'.format("Jan") like Python 3.10.
The new test has an .exp file, because it is not compatible with Python 3.9 and lower. See CPython version of the issue at https://bugs.python.org/issue27772 Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 7d7f0e1df..321bb058d 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -1163,7 +1163,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar
s++;
}
if (*s == '0') {
- if (!align) {
+ if (!align && arg_looks_numeric(arg)) {
align = '=';
}
if (!fill) {