diff Python/compile.c @ 35773:0aef351223da legacy-trunk

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
author Neil Schemenauer <nascheme@enme.ucalgary.ca>
date Sun, 23 Oct 2005 04:24:49 +0000
parents f64fb284ed15
children 95d0a857ae51
line wrap: on
line diff
--- a/Python/compile.c	Sun Oct 23 03:45:42 2005 +0000
+++ b/Python/compile.c	Sun Oct 23 04:24:49 2005 +0000
@@ -2731,7 +2731,8 @@
 			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: