Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be3bd57

Browse files
committed
Remove traces of division_warning left over from Python 2 (#10998)
1 parent 79fe2a3 commit be3bd57

9 files changed

Lines changed: 10 additions & 29 deletions

File tree

Doc/library/sys.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ always available.
232232
+==============================+==========================================+
233233
| :const:`debug` | -d |
234234
+------------------------------+------------------------------------------+
235-
| :const:`division_warning` | -Q |
236-
+------------------------------+------------------------------------------+
237235
| :const:`inspect` | -i |
238236
+------------------------------+------------------------------------------+
239237
| :const:`interactive` | -i |

Doc/whatsnew/3.3.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ that may require changes to your code:
133133
``import site`` will not add site-specific paths to the module search
134134
paths. In previous versions, it did. See changeset for doc changes in
135135
various files. Contributed by Carl Meyer with editions by Éric Araujo.
136+
137+
.. Issue #10998: -Q command-line flags are related artifacts have been
138+
removed. Code checking sys.flags.division_warning will need updating.
139+
Contributed by Éric Araujo.

Include/pydebug.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ PyAPI_DATA(int) Py_BytesWarningFlag;
1616
PyAPI_DATA(int) Py_UseClassExceptionsFlag;
1717
PyAPI_DATA(int) Py_FrozenFlag;
1818
PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
19-
PyAPI_DATA(int) Py_DivisionWarningFlag;
2019
PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
2120
PyAPI_DATA(int) Py_NoUserSiteDirectory;
2221
PyAPI_DATA(int) Py_UnbufferedStdioFlag;

Lib/test/test_cmd_line.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ def test_optimize(self):
3131
self.verify_valid_flag('-O')
3232
self.verify_valid_flag('-OO')
3333

34-
def test_q(self):
35-
self.verify_valid_flag('-Qold')
36-
self.verify_valid_flag('-Qnew')
37-
self.verify_valid_flag('-Qwarn')
38-
self.verify_valid_flag('-Qwarnall')
39-
4034
def test_site_flag(self):
4135
self.verify_valid_flag('-S')
4236

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def __hash__(self):
501501

502502
def test_sys_flags(self):
503503
self.assertTrue(sys.flags)
504-
attrs = ("debug", "division_warning",
504+
attrs = ("debug",
505505
"inspect", "interactive", "optimize", "dont_write_bytecode",
506506
"no_user_site", "no_site", "ignore_environment", "verbose",
507507
"bytes_warning", "quiet")

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
14+
Py_DivisionWarningFlag left over from Python 2.
15+
1316
- Issue #11244: Remove an unnecessary peepholer check that was preventing
1417
negative zeros from being constant-folded properly.
1518

Misc/python.man

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ python \- an interpreted, interactive, object-oriented programming language
3737
.B \-O0
3838
]
3939
[
40-
.B -Q
41-
.I argument
42-
]
43-
[
4440
.B \-s
4541
]
4642
[
@@ -152,15 +148,6 @@ Discard docstrings in addition to the \fB-O\fP optimizations.
152148
Do not print the version and copyright messages. These messages are
153149
also suppressed in non-interactive mode.
154150
.TP
155-
.BI "\-Q " argument
156-
Division control; see PEP 238. The argument must be one of "old" (the
157-
default, int/int and long/long return an int or long), "new" (new
158-
division semantics, i.e. int/int and long/long returns a float),
159-
"warn" (old division semantics with a warning for int/int and
160-
long/long), or "warnall" (old division semantics with a warning for
161-
all use of the division operator). For a use of "warnall", see the
162-
Tools/scripts/fixdiv.py script.
163-
.TP
164151
.B \-s
165152
Don't add user site directory to sys.path.
166153
.TP

Objects/object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ _Py_GetRefTotal(void)
2929
}
3030
#endif /* Py_REF_DEBUG */
3131

32-
int Py_DivisionWarningFlag;
33-
3432
/* Object allocation routines used by NEWOBJ and NEWVAROBJ macros.
3533
These are used by the individual routines for object creation.
3634
Do not call them otherwise, they do not initialize the object! */

Python/sysmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,6 @@ static PyTypeObject FlagsType;
13121312

13131313
static PyStructSequence_Field flags_fields[] = {
13141314
{"debug", "-d"},
1315-
{"division_warning", "-Q"},
13161315
{"inspect", "-i"},
13171316
{"interactive", "-i"},
13181317
{"optimize", "-O or -OO"},
@@ -1336,9 +1335,9 @@ static PyStructSequence_Desc flags_desc = {
13361335
flags__doc__, /* doc */
13371336
flags_fields, /* fields */
13381337
#ifdef RISCOS
1339-
13
1340-
#else
13411338
12
1339+
#else
1340+
11
13421341
#endif
13431342
};
13441343

@@ -1356,7 +1355,6 @@ make_flags(void)
13561355
PyStructSequence_SET_ITEM(seq, pos++, PyLong_FromLong(flag))
13571356

13581357
SetFlag(Py_DebugFlag);
1359-
SetFlag(Py_DivisionWarningFlag);
13601358
SetFlag(Py_InspectFlag);
13611359
SetFlag(Py_InteractiveFlag);
13621360
SetFlag(Py_OptimizeFlag);

0 commit comments

Comments
 (0)