diff options
author | Guido van Rossum <guido@python.org> | 2001-09-04 03:51:09 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-09-04 03:51:09 (GMT) |
commit | 1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2 (patch) | |
tree | 2d41b60cbaa6176a1b889a7d15d1f11449c1ddaa /Modules/main.c | |
parent | 61c345fa37573005b708d239c0911218ca22383c (diff) | |
download | cpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.zip cpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.tar.gz cpython-1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2.tar.bz2 |
PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense. Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/main.c b/Modules/main.c index f38a5c3..eea848f 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -58,7 +58,7 @@ Options and arguments (and corresponding environment variables):\n\ static char *usage_2 = "\ -O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\ -OO : remove doc-strings in addition to the -O optimizations\n\ --Q arg : division options: -Qold (default), -Qwarn, -Qnew\n\ +-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\ -S : don't imply 'import site' on initialization\n\ -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\ @@ -161,7 +161,11 @@ Py_Main(int argc, char **argv) break; } if (strcmp(_PyOS_optarg, "warn") == 0) { - Py_DivisionWarningFlag++; + Py_DivisionWarningFlag = 1; + break; + } + if (strcmp(_PyOS_optarg, "warnall") == 0) { + Py_DivisionWarningFlag = 2; break; } if (strcmp(_PyOS_optarg, "new") == 0) { @@ -170,8 +174,8 @@ Py_Main(int argc, char **argv) break; } fprintf(stderr, - "-Q option should be " - "`-Qold', `-Qwarn' or `-Qnew' only\n"); + "-Q option should be `-Qold', " + "`-Qwarn', `-Qwarnall', or `-Qnew' only\n"); usage(2, argv[0]); /* NOTREACHED */ |