mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Use distutils.debug.DEBUG instead of distutils.core.DEBUG.
Note that distutils.core.DEBUG still works if client code uses it, but the core code avoids circular references by using distutils.debug.
This commit is contained in:
		
							parent
							
								
									5f6228ed46
								
							
						
					
					
						commit
						fcd7353863
					
				
					 7 changed files with 9 additions and 11 deletions
				
			
		|  | @ -923,7 +923,7 @@ def announce (self, msg, level=1): | ||||||
|         log.debug(msg) |         log.debug(msg) | ||||||
| 
 | 
 | ||||||
|     def debug_print (self, msg): |     def debug_print (self, msg): | ||||||
|         from distutils.core import DEBUG |         from distutils.debug import DEBUG | ||||||
|         if DEBUG: |         if DEBUG: | ||||||
|             print msg |             print msg | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -198,7 +198,7 @@ def debug_print (self, msg): | ||||||
|         """Print 'msg' to stdout if the global DEBUG (taken from the |         """Print 'msg' to stdout if the global DEBUG (taken from the | ||||||
|         DISTUTILS_DEBUG environment variable) flag is true. |         DISTUTILS_DEBUG environment variable) flag is true. | ||||||
|         """ |         """ | ||||||
|         from distutils.core import DEBUG |         from distutils.debug import DEBUG | ||||||
|         if DEBUG: |         if DEBUG: | ||||||
|             print msg |             print msg | ||||||
|             sys.stdout.flush() |             sys.stdout.flush() | ||||||
|  |  | ||||||
|  | @ -10,7 +10,8 @@ | ||||||
| import sys, os, string | import sys, os, string | ||||||
| import glob | import glob | ||||||
| from types import * | from types import * | ||||||
| from distutils.core import Command, DEBUG | from distutils.core import Command | ||||||
|  | from distutils.debug import DEBUG | ||||||
| from distutils.util import get_platform | from distutils.util import get_platform | ||||||
| from distutils.file_util import write_file | from distutils.file_util import write_file | ||||||
| from distutils.errors import * | from distutils.errors import * | ||||||
|  |  | ||||||
|  | @ -10,7 +10,8 @@ | ||||||
| 
 | 
 | ||||||
| import sys, os, string | import sys, os, string | ||||||
| from types import * | from types import * | ||||||
| from distutils.core import Command, DEBUG | from distutils.core import Command | ||||||
|  | from distutils.debug import DEBUG | ||||||
| from distutils.sysconfig import get_config_vars | from distutils.sysconfig import get_config_vars | ||||||
| from distutils.errors import DistutilsPlatformError | from distutils.errors import DistutilsPlatformError | ||||||
| from distutils.file_util import write_file | from distutils.file_util import write_file | ||||||
|  |  | ||||||
|  | @ -13,10 +13,7 @@ | ||||||
| import sys, os | import sys, os | ||||||
| from types import * | from types import * | ||||||
| 
 | 
 | ||||||
| # If DISTUTILS_DEBUG is anything other than the empty string, we run in | from distutils.debug import DEBUG | ||||||
| # debug mode. |  | ||||||
| DEBUG = os.environ.get('DISTUTILS_DEBUG') |  | ||||||
| 
 |  | ||||||
| from distutils.errors import * | from distutils.errors import * | ||||||
| from distutils.util import grok_environment_error | from distutils.util import grok_environment_error | ||||||
| 
 | 
 | ||||||
|  | @ -25,7 +22,6 @@ | ||||||
| from distutils.cmd import Command | from distutils.cmd import Command | ||||||
| from distutils.extension import Extension | from distutils.extension import Extension | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| # This is a barebones help message generated displayed when the user | # This is a barebones help message generated displayed when the user | ||||||
| # runs the setup script with no arguments at all.  More useful help | # runs the setup script with no arguments at all.  More useful help | ||||||
| # is generated with various --help options: global help, list commands, | # is generated with various --help options: global help, list commands, | ||||||
|  |  | ||||||
|  | @ -16,7 +16,7 @@ | ||||||
| from distutils.fancy_getopt import FancyGetopt, translate_longopt | from distutils.fancy_getopt import FancyGetopt, translate_longopt | ||||||
| from distutils.util import check_environ, strtobool, rfc822_escape | from distutils.util import check_environ, strtobool, rfc822_escape | ||||||
| from distutils import log | from distutils import log | ||||||
| from distutils.core import DEBUG | from distutils.debug import DEBUG | ||||||
| 
 | 
 | ||||||
| # Regex to define acceptable Distutils command names.  This is not *quite* | # Regex to define acceptable Distutils command names.  This is not *quite* | ||||||
| # the same as a Python NAME -- I don't allow leading underscores.  The fact | # the same as a Python NAME -- I don't allow leading underscores.  The fact | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ def debug_print (self, msg): | ||||||
|         """Print 'msg' to stdout if the global DEBUG (taken from the |         """Print 'msg' to stdout if the global DEBUG (taken from the | ||||||
|         DISTUTILS_DEBUG environment variable) flag is true. |         DISTUTILS_DEBUG environment variable) flag is true. | ||||||
|         """ |         """ | ||||||
|         from distutils.core import DEBUG |         from distutils.debug import DEBUG | ||||||
|         if DEBUG: |         if DEBUG: | ||||||
|             print msg |             print msg | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jeremy Hylton
						Jeremy Hylton