Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler

due to possible uninitialized _config_vars.  Original patch by Alex Gaynor.
This commit is contained in:
Ned Deily 2014-07-06 16:14:33 -07:00
parent 898eb82696
commit 7bc5fb6916
3 changed files with 27 additions and 1 deletions

View file

@ -179,7 +179,8 @@ def customize_compiler(compiler):
# version and build tools may not support the same set
# of CPU architectures for universal builds.
global _config_vars
if not _config_vars.get('CUSTOMIZED_OSX_COMPILER', ''):
# Use get_config_var() to ensure _config_vars is initialized.
if not get_config_var('CUSTOMIZED_OSX_COMPILER'):
import _osx_support
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'