[Python-checkins] CVS: python/dist/src/Python compile.c,2.218,2.219

Jeremy Hylton jhylton@users.sourceforge.net
Mon, 27 Aug 2001 12:45:28 -0700


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

Modified Files:
	compile.c 
Log Message:
If an integer constant can't be generated from an integer literal
because of overflow, generate a long instead.


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.218
retrieving revision 2.219
diff -C2 -d -r2.218 -r2.219
*** compile.c	2001/08/17 18:39:25	2.218
--- compile.c	2001/08/27 19:45:25	2.219
***************
*** 1085,1093 ****
  		x = PyOS_strtol(s, &end, 0);
  	if (*end == '\0') {
! 		if (errno != 0) {
! 			com_error(co, PyExc_OverflowError,
! 				  "integer literal too large");
! 			return NULL;
! 		}
  		return PyInt_FromLong(x);
  	}
--- 1085,1090 ----
  		x = PyOS_strtol(s, &end, 0);
  	if (*end == '\0') {
! 		if (errno != 0)
! 			return PyLong_FromString(s, (char **)0, 0);
  		return PyInt_FromLong(x);
  	}