diff Python/compile.c @ 24770:d75bd9e5c4d9 legacy-trunk

Use PyErr_WarnExplicit() to warn about hex/oct constants, so the correct filename and line number are reported.
author Guido van Rossum <guido@python.org>
date Mon, 12 Aug 2002 21:54:46 +0000
parents eec6832818a3
children ab63af3ec349
line wrap: on
line diff
--- a/Python/compile.c	Mon Aug 12 20:46:18 2002 +0000
+++ b/Python/compile.c	Mon Aug 12 21:54:46 2002 +0000
@@ -1157,10 +1157,15 @@
 	if (s[0] == '0') {
 		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)
+			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() */
 		}