summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-30 04:21:23 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-10-30 04:21:23 (GMT)
commit944078786797b03b415d76b0b2d7f3fb8570b9a4 (patch)
tree452bee864a07539ea284c04daed949d66821eb7d /Doc/library
parent77d574d4aeae4b7b9b976a68b367783a0932b6c8 (diff)
parentb8c5f54248369ff89575c1416a98e13e718a4aa4 (diff)
downloadcpython-944078786797b03b415d76b0b2d7f3fb8570b9a4.zip
cpython-944078786797b03b415d76b0b2d7f3fb8570b9a4.tar.gz
cpython-944078786797b03b415d76b0b2d7f3fb8570b9a4.tar.bz2
Issue #26638: Merge option warning fixes from 3.5 into 3.6
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/2to3.rst28
-rw-r--r--Doc/library/ctypes.rst4
-rw-r--r--Doc/library/gettext.rst2
-rw-r--r--Doc/library/unittest.rst6
-rw-r--r--Doc/library/warnings.rst6
5 files changed, 24 insertions, 22 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index ec59679..ace1bfa 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -41,8 +41,8 @@ It can be converted to Python 3.x code via 2to3 on the command line:
A diff against the original source file is printed. 2to3 can also write the
needed modifications right back to the source file. (A backup of the original
-file is made unless :option:`-n` is also given.) Writing the changes back is
-enabled with the :option:`-w` flag:
+file is made unless :option:`!-n` is also given.) Writing the changes back is
+enabled with the :option:`!-w` flag:
.. code-block:: shell-session
@@ -60,7 +60,7 @@ Comments and exact indentation are preserved throughout the translation process.
By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The
:option:`!-l` flag lists all available fixers. An explicit set of fixers to run
-can be given with :option:`-f`. Likewise the :option:`!-x` explicitly disables a
+can be given with :option:`!-f`. Likewise the :option:`!-x` explicitly disables a
fixer. The following example runs only the ``imports`` and ``has_key`` fixers:
.. code-block:: shell-session
@@ -100,29 +100,29 @@ Since some print statements can be parsed as function calls or statements, 2to3
cannot always read files containing the print function. When 2to3 detects the
presence of the ``from __future__ import print_function`` compiler directive, it
modifies its internal grammar to interpret :func:`print` as a function. This
-change can also be enabled manually with the :option:`-p` flag. Use
-:option:`-p` to run fixers on code that already has had its print statements
+change can also be enabled manually with the :option:`!-p` flag. Use
+:option:`!-p` to run fixers on code that already has had its print statements
converted.
-The :option:`-o` or :option:`--output-dir` option allows specification of an
+The :option:`!-o` or :option:`!--output-dir` option allows specification of an
alternate directory for processed output files to be written to. The
-:option:`-n` flag is required when using this as backup files do not make sense
+:option:`!-n` flag is required when using this as backup files do not make sense
when not overwriting the input files.
.. versionadded:: 3.2.3
- The :option:`-o` option was added.
+ The :option:`!-o` option was added.
-The :option:`!-W` or :option:`--write-unchanged-files` flag tells 2to3 to always
+The :option:`!-W` or :option:`!--write-unchanged-files` flag tells 2to3 to always
write output files even if no changes were required to the file. This is most
-useful with :option:`-o` so that an entire Python source tree is copied with
+useful with :option:`!-o` so that an entire Python source tree is copied with
translation from one directory to another.
-This option implies the :option:`-w` flag as it would not make sense otherwise.
+This option implies the :option:`!-w` flag as it would not make sense otherwise.
.. versionadded:: 3.2.3
The :option:`!-W` flag was added.
-The :option:`--add-suffix` option specifies a string to append to all output
-filenames. The :option:`-n` flag is required when specifying this as backups
+The :option:`!--add-suffix` option specifies a string to append to all output
+filenames. The :option:`!-n` flag is required when specifying this as backups
are not necessary when writing to different filenames. Example:
.. code-block:: shell-session
@@ -132,7 +132,7 @@ are not necessary when writing to different filenames. Example:
Will cause a converted file named ``example.py3`` to be written.
.. versionadded:: 3.2.3
- The :option:`--add-suffix` option was added.
+ The :option:`!--add-suffix` option was added.
To translate an entire project from one directory tree to another use:
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 3381a9d..3840935 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1254,7 +1254,7 @@ the library to load.
Try to find a library and return a pathname. *name* is the library name without
any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version number (this
- is the form used for the posix linker option :option:`-l`). If no library can
+ is the form used for the posix linker option :option:`!-l`). If no library can
be found, returns ``None``.
The exact functionality is system dependent.
@@ -1838,7 +1838,7 @@ Utility functions
Try to find a library and return a pathname. *name* is the library name
without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version
- number (this is the form used for the posix linker option :option:`-l`). If
+ number (this is the form used for the posix linker option :option:`!-l`). If
no library can be found, returns ``None``.
The exact functionality is system dependent.
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
index ea439b5..3a87bf5 100644
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -621,7 +621,7 @@ In this case, you are marking translatable strings with the function
However, you will need to teach your message extraction program to
look for translatable strings marked with :func:`N_`. :program:`xgettext`,
:program:`pygettext`, ``pybabel extract``, and :program:`xpot` all
-support this through the use of the :option:`-k` command-line switch.
+support this through the use of the :option:`!-k` command-line switch.
The choice of :func:`N_` here is totally arbitrary; it could have just
as easily been :func:`MarkThisStringForTranslation`.
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 1b0d7a7..c13a731 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1972,7 +1972,8 @@ Loading and running tests
methods <deprecated-aliases>` are also special-cased and, when the warning
filters are ``'default'`` or ``'always'``, they will appear only once
per-module, in order to avoid too many warning messages. This behavior can
- be overridden using the :option:`-Wd` or :option:`-Wa` options and leaving
+ be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options
+ (see :ref:`Warning control <using-on-warnings>`) and leaving
*warnings* to ``None``.
.. versionchanged:: 3.2
@@ -2053,7 +2054,8 @@ Loading and running tests
The *warnings* argument specifies the :ref:`warning filter <warning-filter>`
that should be used while running the tests. If it's not specified, it will
- remain ``None`` if a :option:`-W` option is passed to :program:`python`,
+ remain ``None`` if a :option:`!-W` option is passed to :program:`python`
+ (see :ref:`Warning control <using-on-warnings>`),
otherwise it will be set to ``'default'``.
Calling ``main`` actually returns an instance of the ``TestProgram`` class.
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index 5a42cc6..f67f4bc 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -267,13 +267,13 @@ Updating Code For New Versions of Python
Warnings that are only of interest to the developer are ignored by default. As
such you should make sure to test your code with typically ignored warnings
made visible. You can do this from the command-line by passing :option:`-Wd <-W>`
-to the interpreter (this is shorthand for :option:`-W default`). This enables
+to the interpreter (this is shorthand for :option:`!-W default`). This enables
default handling for all warnings, including those that are ignored by default.
To change what action is taken for encountered warnings you simply change what
-argument is passed to :option:`-W`, e.g. :option:`-W error`. See the
+argument is passed to :option:`-W`, e.g. :option:`!-W error`. See the
:option:`-W` flag for more details on what is possible.
-To programmatically do the same as :option:`-Wd`, use::
+To programmatically do the same as :option:`!-Wd`, use::
warnings.simplefilter('default')