From: Greg Ward Date: Thu, 8 Jun 2000 00:02:36 +0000 (+0000) Subject: Added 'debug_print()' method (driven by DEBUG global from distutils.core). X-Git-Tag: v2.0b1~1545 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebec02a92c578cbdc7d269735a723c78b3265c19;p=thirdparty%2FPython%2Fcpython.git Added 'debug_print()' method (driven by DEBUG global from distutils.core). --- diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py index 9f63f838a72d..c9b5624f8a23 100644 --- a/Lib/distutils/cmd.py +++ b/Lib/distutils/cmd.py @@ -172,6 +172,15 @@ class Command: if self.verbose >= level: print msg + def debug_print (self, msg): + """Print 'msg' to stdout if the global DEBUG (taken from the + DISTUTILS_DEBUG environment variable) flag is true. + """ + from distutils.core import DEBUG + if DEBUG: + print msg + + # -- Option validation methods ------------------------------------- # (these are very handy in writing the 'finalize_options()' method)