diff options
author | Damien George <damien.p.george@gmail.com> | 2015-06-23 16:08:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-06-23 16:08:51 +0000 |
commit | 2a1090a637e4877af443e57e133808f088848721 (patch) | |
tree | a6548551f12a543366950a372858a7cbf62fb8f4 /py/parsenum.c | |
parent | 228c68a9cd02cfc3e9c6019f82b3b5992b5f613b (diff) |
py: Clarify comment in parsenum.c about ValueError vs SyntaxError.
Diffstat (limited to 'py/parsenum.c')
-rw-r--r-- | py/parsenum.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/parsenum.c b/py/parsenum.c index ae04aa426..c6174db65 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -36,7 +36,8 @@ #endif STATIC NORETURN void raise_exc(mp_obj_t exc, mp_lexer_t *lex) { - // if lex!=NULL then the parser called us and we need to make a SyntaxError with traceback + // if lex!=NULL then the parser called us and we need to convert the + // exception's type from ValueError to SyntaxError and add traceback info if (lex != NULL) { ((mp_obj_base_t*)exc)->type = &mp_type_SyntaxError; mp_obj_exception_add_traceback(exc, lex->source_name, lex->tok_line, MP_QSTR_NULL); @@ -142,7 +143,6 @@ overflow: } value_error: - // if lex!=NULL then the parser called us and we need to make a ValueError with traceback if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_obj_t exc = mp_obj_new_exception_msg(&mp_type_ValueError, "invalid syntax for integer"); |