diff options
Diffstat (limited to 'py/parse.c')
-rw-r--r-- | py/parse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/parse.c b/py/parse.c index 8b68fd35e..6ac544733 100644 --- a/py/parse.c +++ b/py/parse.c @@ -714,7 +714,7 @@ STATIC bool fold_constants(parser_t *parser, uint8_t rule_id, size_t num_args) { mp_obj_t value; if (!mp_parse_node_get_int_maybe(pn_value, &value)) { mp_obj_t exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, - "constant must be an integer"); + MP_ERROR_TEXT("constant must be an integer")); mp_obj_exception_add_traceback(exc, parser->lexer->source_name, ((mp_parse_node_struct_t *)pn1)->source_line, MP_QSTRnull); nlr_raise(exc); @@ -1144,13 +1144,13 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { mp_obj_t exc; if (lex->tok_kind == MP_TOKEN_INDENT) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - "unexpected indent"); + MP_ERROR_TEXT("unexpected indent")); } else if (lex->tok_kind == MP_TOKEN_DEDENT_MISMATCH) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - "unindent doesn't match any outer indent level"); + MP_ERROR_TEXT("unindent doesn't match any outer indent level")); } else { exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, - "invalid syntax"); + MP_ERROR_TEXT("invalid syntax")); } // add traceback to give info about file name and location // we don't have a 'block' name, so just pass the NULL qstr to indicate this |