1 parent 517e170 commit 4d0588dCopy full SHA for 4d0588d
1 file changed
py/objint_longlong.c
@@ -148,7 +148,9 @@ mp_obj_t mp_obj_new_int_from_long_str(const char *s) {
148
char *end;
149
// TODO: this doesn't handle Python hacked 0o octal syntax
150
v = strtoll(s, &end, 0);
151
- assert(*end == 0);
+ if (*end != 0) {
152
+ nlr_jump(mp_obj_new_exception_msg(&mp_type_SyntaxError, "invalid syntax for number"));
153
+ }
154
mp_obj_int_t *o = m_new_obj(mp_obj_int_t);
155
o->base.type = &int_type;
156
o->val = v;
0 commit comments