[Python-checkins] CVS: python/dist/src/Python compile.c,2.108.2.1,2.108.2.2

Guido van Rossum python-dev@python.org
Mon, 7 Aug 2000 12:15:42 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24122

Modified Files:
      Tag: cnri-16-start
	compile.c 
Log Message:
When returning an error from jcompile() (which is passed through by
PyNode_Compile()), make sure that an exception is actually set --
otherwise someone stomped on our error.


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.108.2.1
retrieving revision 2.108.2.2
diff -C2 -r2.108.2.1 -r2.108.2.2
*** compile.c	2000/08/03 16:50:35	2.108.2.1
--- compile.c	2000/08/07 19:15:40	2.108.2.2
***************
*** 3487,3490 ****
--- 3487,3498 ----
  		Py_XDECREF(name);
  	}
+ 	else if (!PyErr_Occurred()) {
+ 		/* This could happen if someone called PyErr_Clear() after an
+ 		   error was reported above.  That's not supposed to happen,
+ 		   but I just plugged one case and I'm not sure there can't be
+ 		   others.  In that case, raise SystemError so that at least
+ 		   it gets reported instead dumping core. */
+ 		PyErr_SetString(PyExc_SystemError, "lost syntax error");
+ 	}
  	com_free(&sc);
  	return co;