From e2c18e90dace36a90b5aa83b8974a5fac8f67e43 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Fri, 17 Aug 2001 20:47:47 +0000 Subject: 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). --- Python/ceval.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Python') diff --git a/Python/ceval.c b/Python/ceval.c index 6ee8ae36a3..d3898fb733 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2928,13 +2928,10 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf) if (current_frame != NULL) { const int codeflags = current_frame->f_code->co_flags; - if (codeflags & CO_NESTED) { + const int compilerflags = codeflags & PyCF_MASK; + if (compilerflags) { result = 1; - cf->cf_flags |= CO_NESTED; - } - if (codeflags & CO_GENERATOR_ALLOWED) { - result = 1; - cf->cf_flags |= CO_GENERATOR_ALLOWED; + cf->cf_flags |= compilerflags; } } return result; -- cgit v1.2.1