mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
- 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.
This commit is contained in:
parent
37e136373e
commit
6c9e130524
11 changed files with 120 additions and 148 deletions
|
@ -1258,19 +1258,7 @@ parsenumber(struct compiling *c, char *s)
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue