[Python-checkins] python/dist/src/Python import.c,2.208.2.1,2.208.2.2
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
Fri, 16 Aug 2002 13:27:19 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv16629
Modified Files:
Tag: ast-branch
import.c
Log Message:
Convert to PyAST_Compile().
Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.208.2.1
retrieving revision 2.208.2.2
diff -C2 -d -r2.208.2.1 -r2.208.2.2
*** import.c 9 Jul 2002 13:22:01 -0000 2.208.2.1
--- import.c 16 Aug 2002 20:27:17 -0000 2.208.2.2
***************
*** 4,9 ****
#include "Python.h"
! #include "node.h"
! #include "token.h"
#include "errcode.h"
#include "marshal.h"
--- 4,9 ----
#include "Python.h"
! #include "Python-ast.h"
! #include "pythonrun.h"
#include "errcode.h"
#include "marshal.h"
***************
*** 653,667 ****
static PyCodeObject *
! parse_source_module(char *pathname, FILE *fp)
{
! PyCodeObject *co;
! node *n;
!
! n = PyParser_SimpleParseFile(fp, pathname, Py_file_input);
! if (n == NULL)
! return NULL;
! co = PyNode_Compile(n, pathname);
! PyNode_Free(n);
return co;
}
--- 653,664 ----
static PyCodeObject *
! parse_source_module(const char *pathname, FILE *fp)
{
! PyCodeObject *co = NULL;
! mod_ty mod;
+ mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, 0);
+ if (mod)
+ co = PyAST_Compile(mod, pathname, NULL);
return co;
}