diff Python/compile.c @ 31042:9c846c3df6f3 legacy-trunk

- Removed FutureWarnings related to hex/oct literals and conversions and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) This addresses most of the remaining semantic changes promised by PEP 237, except for repr() of a long, which still shows the trailing 'L'. The PEP appears to promise warnings for operations that changed semantics compared to Python 2.3, but this is not implemented; we've suffered through enough warnings related to hex/oct literals and I think it's best to be silent now.
author Guido van Rossum <guido@python.org>
date Sat, 29 Nov 2003 23:52:13 +0000
parents 9c7e0227c835
children bc006682acb2
line wrap: on
line diff
--- a/Python/compile.c	Fri Nov 28 21:43:02 2003 +0000
+++ b/Python/compile.c	Sat Nov 29 23:52:13 2003 +0000
@@ -1258,19 +1258,7 @@
 	if (s[0] == '0') {
 		x = (long) PyOS_strtoul(s, &end, 0);
 		if (x < 0 && errno == 0) {
-			if (PyErr_WarnExplicit(
-				    PyExc_FutureWarning,
-				    "hex/oct constants > sys.maxint "
-				    "will return positive values "
-				    "in Python 2.4 and up",
-				    /* XXX: Give WarnExplicit
-				       a const char* argument. */
-				    (char*)c->c_filename,
-				    c->c_lineno,
-				    NULL,
-				    NULL) < 0)
-				return NULL;
-			errno = 0; /* Might be changed by PyErr_Warn() */
+			return PyLong_FromString(s, (char **)0, 0);
 		}
 	}
 	else