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
This commit is contained in:
Neil Schemenauer 2005-10-23 04:24:49 +00:00
parent ac699efad8
commit d403c45386
2 changed files with 11 additions and 1 deletions

View file

@ -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: