From d403c453869f04ab68154dd448f2473e5fed9dca Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Sun, 23 Oct 2005 04:24:49 +0000 Subject: 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 --- Python/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 93cfb641e0..61e22d10fe 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: -- cgit v1.2.1