summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-08-14 15:51:29 (GMT)
committerBarry Warsaw <barry@python.org>2002-08-14 15:51:29 (GMT)
commit9f00739551e0ebef1c337f5640703f63abc4657e (patch)
treead20bde1545c7b7f0c23939c013712f73542a836
parent31d2df5b60a20e43e3a8e23bc1cb8cebc41c96e4 (diff)
downloadcpython-9f00739551e0ebef1c337f5640703f63abc4657e.zip
cpython-9f00739551e0ebef1c337f5640703f63abc4657e.tar.gz
cpython-9f00739551e0ebef1c337f5640703f63abc4657e.tar.bz2
Added a FutureWarning for constructs that will change semantically in
the future. Changed PEP 237 hex constant warnings from DeprecationWarning to FutureWarning. Updated the documentation.
-rw-r--r--Include/pyerrors.h1
-rw-r--r--Python/compile.c2
-rw-r--r--Python/exceptions.c10
3 files changed, 11 insertions, 2 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index a3d9c5d..b783b7b 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -70,6 +70,7 @@ PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning;
PyAPI_DATA(PyObject *) PyExc_SyntaxWarning;
PyAPI_DATA(PyObject *) PyExc_OverflowWarning;
PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
+PyAPI_DATA(PyObject *) PyExc_FutureWarning;
/* Convenience functions */
diff --git a/Python/compile.c b/Python/compile.c
index d1655e9..5b4e8e6 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1158,7 +1158,7 @@ parsenumber(struct compiling *co, char *s)
x = (long) PyOS_strtoul(s, &end, 0);
if (x < 0 && errno == 0) {
if (PyErr_WarnExplicit(
- PyExc_DeprecationWarning,
+ PyExc_FutureWarning,
"hex/oct constants > sys.maxint "
"will return positive values "
"in Python 2.4 and up",
diff --git a/Python/exceptions.c b/Python/exceptions.c
index 934850a..c4bd626 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -112,7 +112,8 @@ Exception\n\
+-- PendingDeprecationWarning\n\
+-- SyntaxWarning\n\
+-- OverflowWarning\n\
- +-- RuntimeWarning"
+ +-- RuntimeWarning\n\
+ +-- FutureWarning"
);
@@ -902,6 +903,10 @@ PyDoc_STRVAR(OverflowWarning__doc__,
PyDoc_STRVAR(RuntimeWarning__doc__,
"Base class for warnings about dubious runtime behavior.");
+PyDoc_STRVAR(FutureWarning__doc__,
+"Base class for warnings about constructs that will change semantically "
+"in the future.");
+
/* module global functions */
@@ -964,6 +969,7 @@ PyObject *PyExc_PendingDeprecationWarning;
PyObject *PyExc_SyntaxWarning;
PyObject *PyExc_OverflowWarning;
PyObject *PyExc_RuntimeWarning;
+PyObject *PyExc_FutureWarning;
@@ -1044,6 +1050,8 @@ static struct {
OverflowWarning__doc__},
{"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning,
RuntimeWarning__doc__},
+ {"FutureWarning", &PyExc_FutureWarning, &PyExc_Warning,
+ FutureWarning__doc__},
/* Sentinel */
{NULL}
};