]> granicus.if.org Git - python/commitdiff
Remove traces of division_warning left over from Python 2 (#10998)
authorÉric Araujo <merwok@netwok.org>
Sat, 26 Mar 2011 00:55:15 +0000 (01:55 +0100)
committerÉric Araujo <merwok@netwok.org>
Sat, 26 Mar 2011 00:55:15 +0000 (01:55 +0100)
Doc/library/sys.rst
Doc/whatsnew/3.3.rst
Include/pydebug.h
Lib/test/test_cmd_line.py
Lib/test/test_sys.py
Misc/NEWS
Misc/python.man
Objects/object.c
Python/sysmodule.c

index b09571f2ad0ae6ffd4c559e0ea72a4e4f5476f0f..56906e7887edf7e44a7779caf6ad3db230f51e1a 100644 (file)
@@ -232,8 +232,6 @@ always available.
    +==============================+==========================================+
    | :const:`debug`               | -d                                       |
    +------------------------------+------------------------------------------+
-   | :const:`division_warning`    | -Q                                       |
-   +------------------------------+------------------------------------------+
    | :const:`inspect`             | -i                                       |
    +------------------------------+------------------------------------------+
    | :const:`interactive`         | -i                                       |
index 7f05a846fc641354063896b1ebaf85871db964c6..2199f0ac72a676b3c4f5dcb189526e73309e6892 100644 (file)
@@ -133,3 +133,7 @@ that may require changes to your code:
    ``import site`` will not add site-specific paths to the module search
    paths.  In previous versions, it did.  See changeset for doc changes in
    various files.  Contributed by Carl Meyer with editions by Éric Araujo.
+
+.. Issue #10998: -Q command-line flags are related artifacts have been
+   removed.  Code checking sys.flags.division_warning will need updating.
+   Contributed by Éric Araujo.
index cafbfd0e2f2184cfdedc637512d6674e39434905..7173fe33394192aa0212c8d7ba708b4f6c471540 100644 (file)
@@ -16,7 +16,6 @@ PyAPI_DATA(int) Py_BytesWarningFlag;
 PyAPI_DATA(int) Py_UseClassExceptionsFlag;
 PyAPI_DATA(int) Py_FrozenFlag;
 PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
-PyAPI_DATA(int) Py_DivisionWarningFlag;
 PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
 PyAPI_DATA(int) Py_NoUserSiteDirectory;
 PyAPI_DATA(int) Py_UnbufferedStdioFlag;
index a0a85aeee80900a91b86172347c58afc56b7377c..57508c7530b70b2a00878617f202cc29be98e5a1 100644 (file)
@@ -31,12 +31,6 @@ class CmdLineTest(unittest.TestCase):
         self.verify_valid_flag('-O')
         self.verify_valid_flag('-OO')
 
-    def test_q(self):
-        self.verify_valid_flag('-Qold')
-        self.verify_valid_flag('-Qnew')
-        self.verify_valid_flag('-Qwarn')
-        self.verify_valid_flag('-Qwarnall')
-
     def test_site_flag(self):
         self.verify_valid_flag('-S')
 
index d412e67965d764187855ed792d4fbc78d8d21806..e18019c15cc720513dbddca1b0036297c0935138 100644 (file)
@@ -501,7 +501,7 @@ class SysModuleTest(unittest.TestCase):
 
     def test_sys_flags(self):
         self.assertTrue(sys.flags)
-        attrs = ("debug", "division_warning",
+        attrs = ("debug",
                  "inspect", "interactive", "optimize", "dont_write_bytecode",
                  "no_user_site", "no_site", "ignore_environment", "verbose",
                  "bytes_warning", "quiet")
index f70998c9db7fa51019fc54928cf8d6f550ea6bec..944a2f639b3236936c5895fa31a983307f71eeae 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
 Core and Builtins
 -----------------
 
+- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
+  Py_DivisionWarningFlag left over from Python 2.
+
 - Issue #11244: Remove an unnecessary peepholer check that was preventing
   negative zeros from being constant-folded properly.
 
index 53b77fcd1bc2120cf31a7278c6fe6284e667ebb8..0ef5467fb2ca8d70f412bf2e643cbc3489dfc8e6 100644 (file)
@@ -37,10 +37,6 @@ python \- an interpreted, interactive, object-oriented programming language
 .B \-O0
 ]
 [
-.B -Q
-.I argument
-]
-[
 .B \-s
 ]
 [
@@ -152,15 +148,6 @@ Discard docstrings in addition to the \fB-O\fP optimizations.
 Do not print the version and copyright messages. These messages are 
 also suppressed in non-interactive mode.
 .TP
-.BI "\-Q " argument
-Division control; see PEP 238.  The argument must be one of "old" (the
-default, int/int and long/long return an int or long), "new" (new
-division semantics, i.e. int/int and long/long returns a float),
-"warn" (old division semantics with a warning for int/int and
-long/long), or "warnall" (old division semantics with a warning for
-all use of the division operator).  For a use of "warnall", see the
-Tools/scripts/fixdiv.py script.
-.TP
 .B \-s
 Don't add user site directory to sys.path.
 .TP
index 17e5069ef513943c35828a0b27c357bad3cb8062..db7882a620bc5aca6c3a0d4d8e03541581bf8e5d 100644 (file)
@@ -29,8 +29,6 @@ _Py_GetRefTotal(void)
 }
 #endif /* Py_REF_DEBUG */
 
-int Py_DivisionWarningFlag;
-
 /* Object allocation routines used by NEWOBJ and NEWVAROBJ macros.
    These are used by the individual routines for object creation.
    Do not call them otherwise, they do not initialize the object! */
index 31c693906875a5e9b7f6ccbd862548a1e8934e08..33255ad72e0d89197f771ee4946c5978d2ee30d5 100644 (file)
@@ -1312,7 +1312,6 @@ static PyTypeObject FlagsType;
 
 static PyStructSequence_Field flags_fields[] = {
     {"debug",                   "-d"},
-    {"division_warning",        "-Q"},
     {"inspect",                 "-i"},
     {"interactive",             "-i"},
     {"optimize",                "-O or -OO"},
@@ -1336,9 +1335,9 @@ static PyStructSequence_Desc flags_desc = {
     flags__doc__,       /* doc */
     flags_fields,       /* fields */
 #ifdef RISCOS
-    13
-#else
     12
+#else
+    11
 #endif
 };
 
@@ -1356,7 +1355,6 @@ make_flags(void)
     PyStructSequence_SET_ITEM(seq, pos++, PyLong_FromLong(flag))
 
     SetFlag(Py_DebugFlag);
-    SetFlag(Py_DivisionWarningFlag);
     SetFlag(Py_InspectFlag);
     SetFlag(Py_InteractiveFlag);
     SetFlag(Py_OptimizeFlag);