make too many nested blocks be a SyntaxError instead of a SystemError (closes #27514)

Patch by Ammar Askar.
This commit is contained in:
Benjamin Peterson 2016-07-14 22:00:03 -07:00
parent 2b8792137b
commit e09ed5419b
3 changed files with 8 additions and 3 deletions

View file

@ -3980,7 +3980,7 @@ compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b)
{
struct fblockinfo *f;
if (c->u->u_nfblocks >= CO_MAXBLOCKS) {
PyErr_SetString(PyExc_SystemError,
PyErr_SetString(PyExc_SyntaxError,
"too many statically nested blocks");
return 0;
}