mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
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.
This commit is contained in:
parent
6fa82a3477
commit
cd8a1148e1
32 changed files with 260 additions and 313 deletions
|
@ -11,6 +11,7 @@ from distutils import sysconfig
|
|||
from distutils.core import Command
|
||||
from distutils.dep_util import newer
|
||||
from distutils.util import convert_path
|
||||
from distutils import log
|
||||
|
||||
# check if Python is called on the first line with this expression
|
||||
first_line_re = re.compile(r'^#!.*python[0-9.]*(\s+.*)?$')
|
||||
|
@ -59,7 +60,7 @@ class build_scripts (Command):
|
|||
outfile = os.path.join(self.build_dir, os.path.basename(script))
|
||||
|
||||
if not self.force and not newer(script, outfile):
|
||||
self.announce("not copying %s (up-to-date)" % script)
|
||||
log.debug("not copying %s (up-to-date)", script)
|
||||
continue
|
||||
|
||||
# Always open the file, but ignore failures in dry-run mode --
|
||||
|
@ -83,8 +84,8 @@ class build_scripts (Command):
|
|||
post_interp = match.group(1) or ''
|
||||
|
||||
if adjust:
|
||||
self.announce("copying and adjusting %s -> %s" %
|
||||
(script, self.build_dir))
|
||||
log.info("copying and adjusting %s -> %s", script,
|
||||
self.build_dir)
|
||||
if not self.dry_run:
|
||||
outf = open(outfile, "w")
|
||||
if not sysconfig.python_build:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue