1717from distutils .util import convert_path , subst_vars , change_root
1818from distutils .util import get_platform
1919from distutils .errors import DistutilsOptionError
20+ from .. import _collections
2021
2122from site import USER_BASE
2223from site import USER_SITE
@@ -394,7 +395,8 @@ def finalize_options(self):
394395 except AttributeError :
395396 # sys.abiflags may not be defined on all platforms.
396397 abiflags = ''
397- self .config_vars = {'dist_name' : self .distribution .get_name (),
398+ local_vars = {
399+ 'dist_name' : self .distribution .get_name (),
398400 'dist_version' : self .distribution .get_version (),
399401 'dist_fullname' : self .distribution .get_fullname (),
400402 'py_version' : py_version ,
@@ -408,28 +410,28 @@ def finalize_options(self):
408410 'platlibdir' : getattr (sys , 'platlibdir' , 'lib' ),
409411 'implementation_lower' : _get_implementation ().lower (),
410412 'implementation' : _get_implementation (),
411- 'platsubdir' : sysconfig .get_config_var ('platsubdir' ),
412413 }
413414
414415 if HAS_USER_SITE :
415- self .config_vars ['userbase' ] = self .install_userbase
416- self .config_vars ['usersite' ] = self .install_usersite
416+ local_vars ['userbase' ] = self .install_userbase
417+ local_vars ['usersite' ] = self .install_usersite
418+
419+ self .config_vars = _collections .DictStack (
420+ [sysconfig .get_config_vars (), local_vars ])
417421
418422 self .expand_basedirs ()
419423
420424 self .dump_dirs ("post-expand_basedirs()" )
421425
422426 # Now define config vars for the base directories so we can expand
423427 # everything else.
424- self .config_vars ['base' ] = self .install_base
425- self .config_vars ['platbase' ] = self .install_platbase
426- self .config_vars ['installed_base' ] = (
427- sysconfig .get_config_vars ()['installed_base' ])
428+ local_vars ['base' ] = self .install_base
429+ local_vars ['platbase' ] = self .install_platbase
428430
429431 if DEBUG :
430432 from pprint import pprint
431433 print ("config vars:" )
432- pprint (self .config_vars )
434+ pprint (dict ( self .config_vars ) )
433435
434436 # Expand "~" and configuration variables in the installation
435437 # directories.
0 commit comments