summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-04-27 21:44:22 -0400
committerBenjamin Peterson <benjamin@python.org>2015-04-27 21:44:22 -0400
commitbe670f799c5cc553ecaadf12d309cf60c9469230 (patch)
tree675bcaf5f60ad0334b466401e884cfacce7edd9a /Python/compile.c
parent13a15fdf72ae04057bc65d050c55096d7ea718d6 (diff)
downloadcpython-be670f799c5cc553ecaadf12d309cf60c9469230.tar.gz
remove the concept of an unoptimized function scope from the compiler, since it can't happen anymore
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c
index d5009e18fa..855ec464af 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2753,8 +2753,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
optype = OP_FAST;
break;
case GLOBAL_IMPLICIT:
- if (c->u->u_ste->ste_type == FunctionBlock &&
- !c->u->u_ste->ste_unoptimized)
+ if (c->u->u_ste->ste_type == FunctionBlock)
optype = OP_GLOBAL;
break;
case GLOBAL_EXPLICIT:
@@ -4185,9 +4184,7 @@ compute_code_flags(struct compiler *c)
int flags = 0;
Py_ssize_t n;
if (ste->ste_type == FunctionBlock) {
- flags |= CO_NEWLOCALS;
- if (!ste->ste_unoptimized)
- flags |= CO_OPTIMIZED;
+ flags |= CO_NEWLOCALS | CO_OPTIMIZED;
if (ste->ste_nested)
flags |= CO_NESTED;
if (ste->ste_generator)