From: Georg Brandl Date: Tue, 13 Mar 2007 21:32:01 +0000 (+0000) Subject: Deprecate commands.getstatus(). X-Git-Tag: v2.6a1~2006 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8044e5bbd46b2ccd4e56fb2fb5424abdf212095c;p=python Deprecate commands.getstatus(). --- diff --git a/Doc/lib/libcommands.tex b/Doc/lib/libcommands.tex index 53b8a20707..fa9b464f86 100644 --- a/Doc/lib/libcommands.tex +++ b/Doc/lib/libcommands.tex @@ -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 function uses the \function{getoutput()} function, and properly 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} Example: diff --git a/Lib/commands.py b/Lib/commands.py index cfbb541cfd..d19aa1a480 100644 --- a/Lib/commands.py +++ b/Lib/commands.py @@ -32,6 +32,8 @@ __all__ = ["getstatusoutput","getoutput","getstatus"] # def getstatus(file): """Return output of "ls -ld " in a string.""" + import warnings + warnings.warn("commands.getstatus() is deprecated", DeprecationWarning) return getoutput('ls -ld' + mkarg(file))