mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
Deprecate commands.getstatus().
This commit is contained in:
parent
8e84c65660
commit
8044e5bbd4
2 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,10 @@ and the return value is a string containing the command's output.
|
||||||
Return the output of \samp{ls -ld \var{file}} as a string. This
|
Return the output of \samp{ls -ld \var{file}} as a string. This
|
||||||
function uses the \function{getoutput()} function, and properly
|
function uses the \function{getoutput()} function, and properly
|
||||||
escapes backslashes and dollar signs in the argument.
|
escapes backslashes and dollar signs in the argument.
|
||||||
|
|
||||||
|
\deprecated{2.6}{This function is nonobvious and useless,
|
||||||
|
also the name is misleading in the presence of
|
||||||
|
\function{getstatusoutput()}.}
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
|
@ -32,6 +32,8 @@ __all__ = ["getstatusoutput","getoutput","getstatus"]
|
||||||
#
|
#
|
||||||
def getstatus(file):
|
def getstatus(file):
|
||||||
"""Return output of "ls -ld <file>" in a string."""
|
"""Return output of "ls -ld <file>" in a string."""
|
||||||
|
import warnings
|
||||||
|
warnings.warn("commands.getstatus() is deprecated", DeprecationWarning)
|
||||||
return getoutput('ls -ld' + mkarg(file))
|
return getoutput('ls -ld' + mkarg(file))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue