]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a FutureWarning for constructs that will change semantically in
authorBarry Warsaw <barry@python.org>
Wed, 14 Aug 2002 15:51:29 +0000 (15:51 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 14 Aug 2002 15:51:29 +0000 (15:51 +0000)
the future.  Changed PEP 237 hex constant warnings from
DeprecationWarning to FutureWarning.  Updated the documentation.

Include/pyerrors.h
Python/compile.c
Python/exceptions.c

index a3d9c5d65ee72102f73dd79ac53a6873e6ffb51d..b783b7ba1d6e041b52867a2a9c1862eeccc2db0c 100644 (file)
@@ -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 */
index d1655e954fcb39563973efcd45c99eca67171188..5b4e8e6420208ed79443361985212268fe624779 100644 (file)
@@ -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",
index 934850aa066146dc46eff3cc2b1bdfcb4195435e..c4bd626dedf079ee8463d67561c7d55702b72d65 100644 (file)
@@ -112,7 +112,8 @@ Exception\n\
       +-- PendingDeprecationWarning\n\
       +-- SyntaxWarning\n\
       +-- OverflowWarning\n\
-      +-- RuntimeWarning"
+      +-- RuntimeWarning\n\
+      +-- FutureWarning"
 );
 
 \f
@@ -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.");
+
 
 \f
 /* module global functions */
@@ -964,6 +969,7 @@ PyObject *PyExc_PendingDeprecationWarning;
 PyObject *PyExc_SyntaxWarning;
 PyObject *PyExc_OverflowWarning;
 PyObject *PyExc_RuntimeWarning;
+PyObject *PyExc_FutureWarning;
 
 
 \f
@@ -1044,6 +1050,8 @@ static struct {
   OverflowWarning__doc__},
  {"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning,
   RuntimeWarning__doc__},
+ {"FutureWarning", &PyExc_FutureWarning, &PyExc_Warning,
+  FutureWarning__doc__},
  /* Sentinel */
  {NULL}
 };