summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extmod/modujson.c2
-rw-r--r--tests/extmod/ujson_loads_float.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modujson.c b/extmod/modujson.c
index 830b588fd..f5c6428ef 100644
--- a/extmod/modujson.c
+++ b/extmod/modujson.c
@@ -185,7 +185,7 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
cur = S_CUR(s);
if (cur == '.' || cur == 'E' || cur == 'e') {
flt = true;
- } else if (cur == '-' || unichar_isdigit(cur)) {
+ } else if (cur == '+' || cur == '-' || unichar_isdigit(cur)) {
// pass
} else {
break;
diff --git a/tests/extmod/ujson_loads_float.py b/tests/extmod/ujson_loads_float.py
index f1b8cc364..086853a2d 100644
--- a/tests/extmod/ujson_loads_float.py
+++ b/tests/extmod/ujson_loads_float.py
@@ -14,4 +14,5 @@ my_print(json.loads('1.2'))
my_print(json.loads('1e2'))
my_print(json.loads('-2.3'))
my_print(json.loads('-2e3'))
+my_print(json.loads('-2e+3'))
my_print(json.loads('-2e-3'))