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.
This commit is contained in:
Thomas Wouters 2006-02-28 20:02:27 +00:00
parent 56820c2bab
commit 5e9f1fa706
1 changed files with 4 additions and 4 deletions

View File

@ -4284,10 +4284,10 @@ compute_code_flags(struct compiler *c)
flags |= CO_VARKEYWORDS; flags |= CO_VARKEYWORDS;
if (ste->ste_generator) if (ste->ste_generator)
flags |= CO_GENERATOR; flags |= CO_GENERATOR;
if (c->c_flags->cf_flags & CO_FUTURE_DIVISION)
flags |= CO_FUTURE_DIVISION; /* (Only) inherit compilerflags in PyCF_MASK */
if (c->c_flags->cf_flags & CO_FUTURE_WITH_STATEMENT) flags |= (c->c_flags->cf_flags & PyCF_MASK);
flags |= CO_FUTURE_WITH_STATEMENT;
n = PyDict_Size(c->u->u_freevars); n = PyDict_Size(c->u->u_freevars);
if (n < 0) if (n < 0)
return -1; return -1;