diff --git a/Python/symtable.c b/Python/symtable.c index 21790b1cd1877c..23aeaaa76f613d 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -199,8 +199,10 @@ symtable_new(void) struct symtable *st; st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable)); - if (st == NULL) + if (st == NULL) { + PyErr_NoMemory(); return NULL; + } st->st_filename = NULL; st->st_symbols = NULL;