mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
ceval, PyEval_MergeCompilerFlags: wasn't merging in the
CO_FUTURE_DIVISION flag. Redid this to use Jeremy's PyCF_MASK #define instead, so we dont have to remember to fiddle individual feature names here again. pythonrun.h: Also #define a PyCF_MASK_OBSOLETE mask. This isn't used yet, but will be as part of the PEP 264 implementation (compile() mustn't raise an error just because old code uses a flag name that's become obsolete; a warning may be appropriate, but not an error; so compile() has to know about obsolete flags too, but nobody is going to remember to update compile() with individual obsolete flag names across releases either -- i.e., this is the flip side of PyEval_MergeCompilerFlags's oversight).
This commit is contained in:
parent
9676b22cd7
commit
e2c18e90da
2 changed files with 5 additions and 6 deletions
|
@ -8,6 +8,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION)
|
||||
#define PyCF_MASK_OBSOLETE (CO_NESTED)
|
||||
|
||||
typedef struct {
|
||||
int cf_flags; /* bitmask of CO_xxx flags relevant to future */
|
||||
} PyCompilerFlags;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue