]> granicus.if.org Git - python/commitdiff
#5841: add deprecation py3k warning and notice in the docs for commands module.
authorGeorg Brandl <georg@python.org>
Sat, 25 Apr 2009 15:11:29 +0000 (15:11 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 25 Apr 2009 15:11:29 +0000 (15:11 +0000)
Doc/library/commands.rst
Lib/commands.py

index 84ef257a37f5e99ad6950b70d58333f5b6f7ccbd..a700628c79d850f90140fd579d0be9b7b308e33f 100644 (file)
@@ -5,6 +5,12 @@
 .. module:: commands
    :platform: Unix
    :synopsis: Utility functions for running external commands.
+   :deprecated:
+
+.. deprecated:: 2.6
+   The :mod:`commands` module has been removed in Python 3.0.  Use the
+   :mod:`subprocess` module instead.
+
 .. sectionauthor:: Sue Williams <sbw@provis.com>
 
 
index 287aa27f4dd3d1fb10a5daae57df0600c3d0743a..ccaaaee6ff55a62d5c77c6a1eb25cc42b2ac9f89 100644 (file)
@@ -18,6 +18,10 @@ Encapsulates the basic operation:
 
  [Note:  it would be nice to add functions to interpret the exit status.]
 """
+from warnings import warnpy3k
+warnpy3k("the commands module has been removed in Python 3.0; "
+         "use the subprocess module instead", stacklevel=2)
+del warnpy3k
 
 __all__ = ["getstatusoutput","getoutput","getstatus"]
 
@@ -63,8 +67,6 @@ def getstatusoutput(cmd):
 # Make command argument from directory and pathname (prefix space, add quotes).
 #
 def mk2arg(head, x):
-    from warnings import warnpy3k
-    warnpy3k("In 3.x, mk2arg has been removed.")
     import os
     return mkarg(os.path.join(head, x))
 
@@ -77,8 +79,6 @@ def mk2arg(head, x):
 # with backslash.
 #
 def mkarg(x):
-    from warnings import warnpy3k
-    warnpy3k("in 3.x, mkarg has been removed.")
     if '\'' not in x:
         return ' \'' + x + '\''
     s = ' "'