[Python-checkins] python/dist/src/Python compile.c,2.254,2.255

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
2002年8月12日 14:54:48 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv20166
Modified Files:
	compile.c 
Log Message:
Use PyErr_WarnExplicit() to warn about hex/oct constants, so the
correct filename and line number are reported.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.254
retrieving revision 2.255
diff -C2 -d -r2.254 -r2.255
*** compile.c	11 Aug 2002 14:06:15 -0000	2.254
--- compile.c	12 Aug 2002 21:54:46 -0000	2.255
***************
*** 1158,1165 ****
 		x = (long) PyOS_strtoul(s, &end, 0);
 		if (x < 0 && errno == 0) {
! 			if (PyErr_Warn(PyExc_DeprecationWarning,
! 				 "hex/oct constants > sys.maxint "
! 				 "will return positive values "
! 				 "in Python 2.4 and up") < 0)
 				return NULL;
 			errno = 0; /* Might be changed by PyErr_Warn() */
--- 1158,1170 ----
 		x = (long) PyOS_strtoul(s, &end, 0);
 		if (x < 0 && errno == 0) {
! 			if (PyErr_WarnExplicit(
! 				 PyExc_DeprecationWarning,
! 				 "hex/oct constants > sys.maxint "
! 				 "will return positive values "
! 				 "in Python 2.4 and up",
! 				 co->c_filename,
! 				 co->c_lineno,
! 				 NULL,
! 				 NULL) < 0)
 				return NULL;
 			errno = 0; /* Might be changed by PyErr_Warn() */

AltStyle によって変換されたページ (->オリジナル) /