[Python-checkins] python/dist/src/Include compile.h,2.29,2.29.2.1

jhylton@sourceforge.net jhylton@sourceforge.net
Sat, 20 Apr 2002 11:21:01 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv7175

Modified Files:
      Tag: release21-maint
	compile.h 
Log Message:
Backport fixes for two nested scopes bugs.

frameobject.c: make sure free and cell vars make it into locals, which
    makes eval work.

bltinmodule.c & ceval.c: make sure a code object with free variables
    that is passed to exec or eval raises an exception.

Also duplicate the current trunk test suite in the 2.1 branch, except
for certain necessary changes: different warnings raised by 2.1, need
for __future__.



Index: compile.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v
retrieving revision 2.29
retrieving revision 2.29.2.1
diff -C2 -d -r2.29 -r2.29.2.1
*** compile.h	22 Mar 2001 02:32:48 -0000	2.29
--- compile.h	20 Apr 2002 18:20:59 -0000	2.29.2.1
***************
*** 38,41 ****
--- 38,42 ----
  
  #define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
+ #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
  
  #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */