diff options
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Python/compile.c b/Python/compile.c index 6963a151a7..5341e6b535 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -857,6 +857,8 @@ opcode_stack_effect(int opcode, int oparg) return 1; case STORE_DEREF: return -1; + case DELETE_DEREF: + return 0; default: fprintf(stderr, "opcode = %d\n", opcode); Py_FatalError("opcode_stack_effect()"); @@ -2506,13 +2508,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) case AugLoad: case AugStore: break; - case Del: - PyErr_Format(PyExc_SyntaxError, - "can not delete variable '%S' referenced " - "in nested scope", - name); - Py_DECREF(mangled); - return 0; + case Del: op = DELETE_DEREF; break; case Param: default: PyErr_SetString(PyExc_SystemError, |