This broke test_pyclbr by making it be skipped thanks to a failing import.
-Brett
On 5/11/07, neal.norwitz <[email protected]> wrote:
Author: neal.norwitz
Date: Fri May 11 09:01:52 2007
New Revision: 55246
Modified:
python/branches/p3yk/Doc/lib/libcommands.tex
python/branches/p3yk/Lib/commands.py
python/branches/p3yk/Lib/test/test_commands.py
python/branches/p3yk/Misc/NEWS
Log:
Remove commands.getstatus() it is obsolete.
Modified: python/branches/p3yk/Doc/lib/libcommands.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libcommands.tex (original)
+++ python/branches/p3yk/Doc/lib/libcommands.tex Fri May 11
09:01:52 2007
@@ -35,16 +35,6 @@
and the return value is a string containing the command's output.
\end{funcdesc}
-\begin{funcdesc}{getstatus}{file}
-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:
\begin{verbatim}
@@ -57,8 +47,6 @@
(256, 'sh: /bin/junk: not found')
>>> commands.getoutput('ls /bin/ls')
'/bin/ls'
->>> commands.getstatus('/bin/ls')
-'-rwxr-xr-x 1 root 13352 Oct 14 1994 /bin/ls'
\end{verbatim}
\begin{seealso}
Modified: python/branches/p3yk/Lib/commands.py
==============================================================================
--- python/branches/p3yk/Lib/commands.py (original)
+++ python/branches/p3yk/Lib/commands.py Fri May 11 09:01:52 2007
@@ -19,7 +19,7 @@
[Note: it would be nice to add functions to interpret the exit status.]
"""
-__all__ = ["getstatusoutput","getoutput","getstatus"]
+__all__ = ["getstatusoutput", "getoutput"]
# Module 'commands'
#
@@ -28,15 +28,6 @@
# NB This only works (and is only relevant) for UNIX.
-# Get 'ls -l' status for an object into a string
-#
-def getstatus(file):
- """Return output of "ls -ld <file>" in a string."""
- import warnings
- warnings.warn("commands.getstatus() is deprecated",
DeprecationWarning)
- return getoutput('ls -ld' + mkarg(file))
-
-
# Get the output from a shell command into a string.
# The exit status is ignored; a trailing newline is stripped.
# Assume the command will work with '{ ... ; } 2>&1' around it..
Modified: python/branches/p3yk/Lib/test/test_commands.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_commands.py (original)
+++ python/branches/p3yk/Lib/test/test_commands.py Fri May 11
09:01:52 2007
@@ -4,10 +4,6 @@
'''
import unittest
import os, tempfile, re
-import warnings
-
-warnings.filterwarnings('ignore', r".*commands.getstatus.. is
deprecated",
- DeprecationWarning)
from test.test_support import TestSkipped, run_unittest, reap_children
from commands import *
@@ -42,28 +38,10 @@
if dir is not None:
os.rmdir(dir)
- def test_getstatus(self):
- # This pattern should match 'ls -ld /.' on any posix
- # system, however perversely configured. Even on systems
- # (e.g., Cygwin) where user and group names can have spaces:
- # drwxr-xr-x 15 Administ Domain U 4096 Aug 12 12:50 /
- # drwxr-xr-x 15 Joe User My Group 4096 Aug 12 12:50 /
- # Note that the first case above has a space in the group name
- # while the second one has a space in both names.
- pat = r'''d......... # It is a directory.
- \+? # It may have ACLs.
- \s+\d+ # It has some number of links.
- [^/]* # Skip user, group, size, and date.
- /\. # and end with the name of the file.
- '''
-
- self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))
-
def test_main():
run_unittest(CommandTests)
reap_children()
-
if __name__ == "__main__":
test_main()
Modified: python/branches/p3yk/Misc/NEWS
==============================================================================
--- python/branches/p3yk/Misc/NEWS (original)
+++ python/branches/p3yk/Misc/NEWS Fri May 11 09:01:52 2007
@@ -172,6 +172,8 @@
Library
-------
+- Remove commands.getstatus() it was obsolete.
+
- Remove functions in string and strop modules that are also string
methods.
- Remove obsolete modules: xmllib, stringold.
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins