mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Handle a couple of uncaught errors. This should be backported
This commit is contained in:
parent
b8ae3d0138
commit
dc9b32e1ab
1 changed files with 4 additions and 0 deletions
|
@ -244,6 +244,8 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
|
||||||
goto error;
|
goto error;
|
||||||
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
|
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
|
||||||
arena));
|
arena));
|
||||||
|
if (!asdl_seq_GET(stmts, 0))
|
||||||
|
goto error;
|
||||||
return Interactive(stmts, arena);
|
return Interactive(stmts, arena);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -675,6 +677,8 @@ ast_for_arguments(struct compiling *c, const node *n)
|
||||||
if (NCH(ch) != 1) {
|
if (NCH(ch) != 1) {
|
||||||
/* We have complex arguments, setup for unpacking. */
|
/* We have complex arguments, setup for unpacking. */
|
||||||
asdl_seq_SET(args, k++, compiler_complex_args(c, ch));
|
asdl_seq_SET(args, k++, compiler_complex_args(c, ch));
|
||||||
|
if (!asdl_seq_GET(args, k-1))
|
||||||
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
/* def foo((x)): setup for checking NAME below. */
|
/* def foo((x)): setup for checking NAME below. */
|
||||||
/* Loop because there can be many parens and tuple
|
/* Loop because there can be many parens and tuple
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue