Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
2a1090a6
Commit
2a1090a6
authored
Jun 23, 2015
by
Damien George
Browse files
py: Clarify comment in parsenum.c about ValueError vs SyntaxError.
parent
228c68a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/parsenum.c
View file @
2a1090a6
...
...
@@ -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"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment