mirror of
https://github.com/python/cpython.git
synced 2024-11-27 03:45:08 +08:00
Only print debugging output if DEBUG (imported from distutils.core) is true.
This commit is contained in:
parent
0eeebfda98
commit
fbb04c448c
@ -8,7 +8,7 @@ __revision__ = "$Id$"
|
|||||||
|
|
||||||
import sys, os, string
|
import sys, os, string
|
||||||
from types import *
|
from types import *
|
||||||
from distutils.core import Command
|
from distutils.core import Command, DEBUG
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
from distutils.util import write_file, native_path, subst_vars, change_root
|
from distutils.util import write_file, native_path, subst_vars, change_root
|
||||||
from distutils.errors import DistutilsOptionError
|
from distutils.errors import DistutilsOptionError
|
||||||
@ -240,9 +240,10 @@ class install (Command):
|
|||||||
self.config_vars['base'] = self.install_base
|
self.config_vars['base'] = self.install_base
|
||||||
self.config_vars['platbase'] = self.install_platbase
|
self.config_vars['platbase'] = self.install_platbase
|
||||||
|
|
||||||
from pprint import pprint
|
if DEBUG:
|
||||||
print "config vars:"
|
from pprint import pprint
|
||||||
pprint (self.config_vars)
|
print "config vars:"
|
||||||
|
pprint (self.config_vars)
|
||||||
|
|
||||||
# Expand "~" and configuration variables in the installation
|
# Expand "~" and configuration variables in the installation
|
||||||
# directories.
|
# directories.
|
||||||
@ -289,17 +290,17 @@ class install (Command):
|
|||||||
# finalize_options ()
|
# finalize_options ()
|
||||||
|
|
||||||
|
|
||||||
# hack for debugging output
|
|
||||||
def dump_dirs (self, msg):
|
def dump_dirs (self, msg):
|
||||||
from distutils.fancy_getopt import longopt_xlate
|
if DEBUG:
|
||||||
print msg + ":"
|
from distutils.fancy_getopt import longopt_xlate
|
||||||
for opt in self.user_options:
|
print msg + ":"
|
||||||
opt_name = opt[0]
|
for opt in self.user_options:
|
||||||
if opt_name[-1] == "=":
|
opt_name = opt[0]
|
||||||
opt_name = opt_name[0:-1]
|
if opt_name[-1] == "=":
|
||||||
opt_name = string.translate (opt_name, longopt_xlate)
|
opt_name = opt_name[0:-1]
|
||||||
val = getattr (self, opt_name)
|
opt_name = string.translate (opt_name, longopt_xlate)
|
||||||
print " %s: %s" % (opt_name, val)
|
val = getattr (self, opt_name)
|
||||||
|
print " %s: %s" % (opt_name, val)
|
||||||
|
|
||||||
|
|
||||||
def finalize_unix (self):
|
def finalize_unix (self):
|
||||||
|
Loading…
Reference in New Issue
Block a user