diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2005-10-23 04:24:49 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2005-10-23 04:24:49 (GMT) |
commit | d403c453869f04ab68154dd448f2473e5fed9dca (patch) | |
tree | 102c74572858ba8865ffe30cfb33c493122403d4 /Python | |
parent | ac699efad8ec4967db47d719df29b2f30cc5ee54 (diff) | |
download | cpython-d403c453869f04ab68154dd448f2473e5fed9dca.zip cpython-d403c453869f04ab68154dd448f2473e5fed9dca.tar.gz cpython-d403c453869f04ab68154dd448f2473e5fed9dca.tar.bz2 |
Fix arigo's funky LOAD_NAME bug: implicit globals inside classes have
historically been looked up using LOAD_NAME, not LOAD_GLOBAL.
looked up by LOAD_NAME, not
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index 93cfb64..61e22d1 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2731,7 +2731,8 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) optype = OP_FAST; break; case GLOBAL_IMPLICIT: - if (!c->u->u_ste->ste_unoptimized) + if (c->u->u_ste->ste_type == FunctionBlock && + !c->u->u_ste->ste_unoptimized) optype = OP_GLOBAL; break; case GLOBAL_EXPLICIT: |