mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Refactor future feature handling
Replace uses of PyCF_xxx with CO_xxx. Replace individual feature slots in PyFutureFeatures with single bitmask ff_features. When flags must be transfered among the three parts of the interpreter that care about them -- the pythonrun layer, the compiler, and the future feature parser -- can simply or (|) the definitions.
This commit is contained in:
parent
fdd12f66bb
commit
b857ba261f
4 changed files with 17 additions and 52 deletions
|
@ -2937,11 +2937,11 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
|
|||
const int codeflags = current_frame->f_code->co_flags;
|
||||
if (codeflags & CO_NESTED) {
|
||||
result = 1;
|
||||
cf->cf_flags |= PyCF_NESTED_SCOPES;
|
||||
cf->cf_flags |= CO_NESTED;
|
||||
}
|
||||
if (codeflags & CO_GENERATOR_ALLOWED) {
|
||||
result = 1;
|
||||
cf->cf_flags |= PyCF_GENERATORS;
|
||||
cf->cf_flags |= CO_GENERATOR_ALLOWED;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue