[Python-checkins] python/dist/src/Parser parsetok.c,2.30,2.31
theller@users.sourceforge.net
theller@users.sourceforge.net
Tue, 09 Jul 2002 02:23:29 -0700
Update of /cvsroot/python/python/dist/src/Parser
In directory usw-pr-cvs1:/tmp/cvs-serv24231/Parser
Modified Files:
parsetok.c
Log Message:
Fix SF Bug 564931: compile() traceback must include filename.
Index: parsetok.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/parsetok.c,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -d -r2.30 -r2.31
*** parsetok.c 22 Mar 2002 23:53:03 -0000 2.30
--- parsetok.c 9 Jul 2002 09:23:27 -0000 2.31
***************
*** 28,34 ****
perrdetail *err_ret, int flags)
{
struct tok_state *tok;
! initerr(err_ret, NULL);
if ((tok = PyTokenizer_FromString(s)) == NULL) {
--- 28,43 ----
perrdetail *err_ret, int flags)
{
+ return PyParser_ParseStringFlagsFilename(s, NULL,
+ g, start, err_ret, 0);
+ }
+
+ node *
+ PyParser_ParseStringFlagsFilename(char *s, char *filename,
+ grammar *g, int start,
+ perrdetail *err_ret, int flags)
+ {
struct tok_state *tok;
! initerr(err_ret, filename);
if ((tok = PyTokenizer_FromString(s)) == NULL) {
***************
*** 38,42 ****
if (Py_TabcheckFlag || Py_VerboseFlag) {
! tok->filename = "<string>";
tok->altwarning = (tok->filename != NULL);
if (Py_TabcheckFlag >= 2)
--- 47,51 ----
if (Py_TabcheckFlag || Py_VerboseFlag) {
! tok->filename = filename ? filename : "<string>";
tok->altwarning = (tok->filename != NULL);
if (Py_TabcheckFlag >= 2)