[Python-checkins] python/dist/src/Python ast.c,1.1.2.60,1.1.2.61

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Tue Apr 26 05:53:15 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21189/Python

Modified Files:
      Tag: ast-branch
	ast.c 
Log Message:
Make sure non-SyntaxError exceptions propagate up the call chain.  Also allow
ast_for_atom() to return NULL.

Applies patch #1189210 which fixes bug #1186345.  Thanks John Ehresman.


Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.60
retrieving revision 1.1.2.61
diff -u -d -r1.1.2.60 -r1.1.2.61
--- ast.c	15 Apr 2005 02:18:24 -0000	1.1.2.60
+++ ast.c	26 Apr 2005 03:53:12 -0000	1.1.2.61
@@ -101,6 +101,9 @@
     int lineno;
 
     assert(PyErr_Occurred());
+    if (!PyErr_ExceptionMatches(PyExc_SyntaxError))
+	return;
+
     PyErr_Fetch(&type, &value, &tback);
     errstr = PyTuple_GetItem(value, 0);
     if (!errstr)
@@ -1512,7 +1515,8 @@
         }
         case power: {
             expr_ty e = ast_for_atom(c, CHILD(n, 0));
-            assert(e);
+	    if (!e)
+		return NULL;
             if (NCH(n) == 1)
                 return e;
             /* power: atom trailer* ('**' factor)*



More information about the Python-checkins mailing list