summaryrefslogtreecommitdiff
path: root/Lib/distutils/spawn.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 +0000
commitcd8a1148e19116db109f27d26c02e1de536dc76e (patch)
treee3969bc16f8ef0c540f1d0e72fb0da711344d758 /Lib/distutils/spawn.py
parent6fa82a34775576b90c8ec38e8968dfbb0b02e11d (diff)
downloadcpython-git-cd8a1148e19116db109f27d26c02e1de536dc76e.tar.gz
Make setup.py less chatty by default.
This is a conservative version of SF patch 504889. It uses the log module instead of calling print in various places, and it ignores the verbose argument passed to many functions and set as an attribute on some objects. Instead, it uses the verbosity set on the logger via the command line. The log module is now preferred over announce() and warn() methods that exist only for backwards compatibility. XXX This checkin changes a lot of modules that have no test suite and aren't exercised by the Python build process. It will need substantial testing.
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r--Lib/distutils/spawn.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index 5b6016e0d8..4df6e097de 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -12,7 +12,7 @@ __revision__ = "$Id$"
import sys, os, string
from distutils.errors import *
-
+from distutils import log
def spawn (cmd,
search_path=1,
@@ -27,19 +27,18 @@ def spawn (cmd,
If 'search_path' is true (the default), the system's executable search
path will be used to find the program; otherwise, cmd[0] must be the
- exact path to the executable. If 'verbose' is true, a one-line summary
- of the command will be printed before it is run. If 'dry_run' is true,
+ exact path to the executable.If 'dry_run' is true,
the command will not actually be run.
Raise DistutilsExecError if running the program fails in any way; just
return on success.
"""
if os.name == 'posix':
- _spawn_posix(cmd, search_path, verbose, dry_run)
+ _spawn_posix(cmd, search_path, dry_run=dry_run)
elif os.name == 'nt':
- _spawn_nt(cmd, search_path, verbose, dry_run)
+ _spawn_nt(cmd, search_path, dry_run=dry_run)
elif os.name == 'os2':
- _spawn_os2(cmd, search_path, verbose, dry_run)
+ _spawn_os2(cmd, search_path, dry_run=dry_run)
else:
raise DistutilsPlatformError, \
"don't know how to spawn programs on platform '%s'" % os.name
@@ -74,8 +73,7 @@ def _spawn_nt (cmd,
if search_path:
# either we find one or it stays the same
executable = find_executable(executable) or executable
- if verbose:
- print string.join([executable] + cmd[1:], ' ')
+ log.info(string.join([executable] + cmd[1:], ' '))
if not dry_run:
# spawn for NT requires a full path to the .exe
try:
@@ -100,8 +98,7 @@ def _spawn_os2 (cmd,
if search_path:
# either we find one or it stays the same
executable = find_executable(executable) or executable
- if verbose:
- print string.join([executable] + cmd[1:], ' ')
+ log.info(string.join([executable] + cmd[1:], ' '))
if not dry_run:
# spawnv for OS/2 EMX requires a full path to the .exe
try:
@@ -122,8 +119,7 @@ def _spawn_posix (cmd,
verbose=0,
dry_run=0):
- if verbose:
- print string.join(cmd, ' ')
+ log.info(string.join(cmd, ' '))
if dry_run:
return
exec_fn = search_path and os.execvp or os.execv