summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-28 20:02:27 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-28 20:02:27 (GMT)
commit5e9f1fa706518e0c5c1052652c9783d4f8672b57 (patch)
tree8544fdc56a89c88f1c5c74afb01e7ac1205da67b /Python
parent56820c2babcfb20b4625e30671c996dac5d18494 (diff)
downloadcpython-5e9f1fa706518e0c5c1052652c9783d4f8672b57.zip
cpython-5e9f1fa706518e0c5c1052652c9783d4f8672b57.tar.gz
cpython-5e9f1fa706518e0c5c1052652c9783d4f8672b57.tar.bz2
Generally inehrit codeflags that are in PyCF_MASK, instead of writing it out
in multiple places. This makes compile()/eval()/etc also inherit the absolute-import codeflag, like division and with-statement already were.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 13e0f6d..9547992 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4284,10 +4284,10 @@ compute_code_flags(struct compiler *c)
flags |= CO_VARKEYWORDS;
if (ste->ste_generator)
flags |= CO_GENERATOR;
- if (c->c_flags->cf_flags & CO_FUTURE_DIVISION)
- flags |= CO_FUTURE_DIVISION;
- if (c->c_flags->cf_flags & CO_FUTURE_WITH_STATEMENT)
- flags |= CO_FUTURE_WITH_STATEMENT;
+
+ /* (Only) inherit compilerflags in PyCF_MASK */
+ flags |= (c->c_flags->cf_flags & PyCF_MASK);
+
n = PyDict_Size(c->u->u_freevars);
if (n < 0)
return -1;