[Python-checkins] CVS: python/dist/src/Python ceval.c,2.267,2.268
Tim Peters
tim_one@users.sourceforge.net
Fri, 17 Aug 2001 13:47:49 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv22472/Python
Modified Files:
ceval.c
Log Message:
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).
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.267
retrieving revision 2.268
diff -C2 -d -r2.267 -r2.268
*** ceval.c 2001/08/16 13:15:00 2.267
--- ceval.c 2001/08/17 20:47:47 2.268
***************
*** 2929,2939 ****
if (current_frame != NULL) {
const int codeflags = current_frame->f_code->co_flags;
! if (codeflags & CO_NESTED) {
! result = 1;
! cf->cf_flags |= CO_NESTED;
! }
! if (codeflags & CO_GENERATOR_ALLOWED) {
result = 1;
! cf->cf_flags |= CO_GENERATOR_ALLOWED;
}
}
--- 2929,2936 ----
if (current_frame != NULL) {
const int codeflags = current_frame->f_code->co_flags;
! const int compilerflags = codeflags & PyCF_MASK;
! if (compilerflags) {
result = 1;
! cf->cf_flags |= compilerflags;
}
}