[Python-checkins] r63721 - in python/trunk: Doc/library/commands.rst Lib/commands.py Lib/test/test_py3kwarn.py

Brett Cannon brett at python.org
Mon May 26 22:06:28 CEST 2008


On Mon, May 26, 2008 at 12:41 PM, benjamin.peterson
<python-checkins at python.org> wrote:
> Author: benjamin.peterson
> Date: Mon May 26 21:41:53 2008
> New Revision: 63721
>
> Log:
> warn about some members of the commands module
>
>
> Modified:
>   python/trunk/Doc/library/commands.rst
>   python/trunk/Lib/commands.py
>   python/trunk/Lib/test/test_py3kwarn.py
>
> Modified: python/trunk/Doc/library/commands.rst
> ==============================================================================
> --- python/trunk/Doc/library/commands.rst       (original)
> +++ python/trunk/Doc/library/commands.rst       Mon May 26 21:41:53 2008
> @@ -42,7 +42,13 @@
>

Can you add a mention that the module has been renamed and merged with
'subprocess'?

>    .. deprecated:: 2.6
>       This function is nonobvious and useless, also the name is misleading in the
> -      presence of :func:`getstatusoutput`.
> +      presence of :func:`getstatusoutput`.  It is removed in 3.x.
> +

The deprecation implies that it has been removed in Py3K, so the extra
line is not really needed. If you want to keep it, though, please
disambiguate it by not using "It".

> +.. warning::
> +
> +   Two undocumented functions in this module, :func:`mk2arg` and :func:`mkargs`
> +   are removed in 3.x.
> +
>



>  Example::
>
>
> Modified: python/trunk/Lib/commands.py
> ==============================================================================
> --- python/trunk/Lib/commands.py        (original)
> +++ python/trunk/Lib/commands.py        Mon May 26 21:41:53 2008
> @@ -63,6 +63,8 @@
>  # Make command argument from directory and pathname (prefix space, add quotes).
>  #
>  def mk2arg(head, x):
> +    from warnings import warnpy3k
> +    warnpy3k("In 3.x, mk2arg is removed.")

It's better to say "the mk2arg() function has been removed in Python 3.0".

>     import os
>     return mkarg(os.path.join(head, x))
>
> @@ -75,6 +77,8 @@
>  # with backslash.
>  #
>  def mkarg(x):
> +    from warnings import warnpy3k
> +    warnpy3k("in 3.x, mkarg is remove.")

See above (plus you left off a "d"  =).

-Brett


More information about the Python-checkins mailing list