aboutsummaryrefslogtreecommitdiff
path: root/py/qstrdefs.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2018-09-16 07:23:53 +0300
committerDamien George <damien.p.george@gmail.com>2018-09-20 14:41:35 +1000
commit93f29975db5c643aa367260d8163885e06a08170 (patch)
treed3f415f48196ed87d0f7a2ef4817c9aafaa7b651 /py/qstrdefs.h
parent2da5d41350d2b1644614a5ce8de557a283d7460a (diff)
py/modbuiltins: Make oct/hex work when !MICROPY_PY_BUILTINS_STR_OP_MODULO
Instead of redirecting to str.__mod__(), use str.format() in this case.
Diffstat (limited to 'py/qstrdefs.h')
-rw-r--r--py/qstrdefs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index a60905812..5c8b13b47 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -37,8 +37,13 @@ Q()
Q(*)
Q(_)
Q(/)
+#if MICROPY_PY_BUILTINS_STR_OP_MODULO
Q(%#o)
Q(%#x)
+#else
+Q({:#o})
+Q({:#x})
+#endif
Q({:#b})
Q( )
Q(\n)