diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-20 22:37:19 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-20 22:37:19 (GMT) |
commit | 013783c529cfc459d05d261f5053ad7bf7d88c29 (patch) | |
tree | 14e1b8205a78e85d9ba688f315cf89f82aad3a20 /Python/compile.c | |
parent | 533a167a713be4a30b92583636cd2323f4c8c3aa (diff) | |
download | cpython-013783c529cfc459d05d261f5053ad7bf7d88c29.zip cpython-013783c529cfc459d05d261f5053ad7bf7d88c29.tar.gz cpython-013783c529cfc459d05d261f5053ad7bf7d88c29.tar.bz2 |
move test_trace.py so as not to conflict with future tests for the trace module
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index aae0339..83c9e02 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -787,6 +787,7 @@ opcode_stack_effect(int opcode, int oparg) case LOAD_CONST: return 1; case LOAD_NAME: + case LOAD_NAME_LOCAL_ONLY: return 1; case BUILD_TUPLE: case BUILD_LIST: @@ -2481,6 +2482,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) optype = OP_DEREF; break; case LOCAL: + case LOCAL_ONLY: if (c->u->u_ste->ste_type == FunctionBlock) optype = OP_FAST; break; @@ -2556,7 +2558,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) break; case OP_NAME: switch (ctx) { - case Load: op = LOAD_NAME; break; + case Load: op = (scope == LOCAL_ONLY) ? LOAD_NAME_LOCAL_ONLY : LOAD_NAME; break; case Store: op = STORE_NAME; break; case Del: op = DELETE_NAME; break; case AugLoad: |