|
53 | 53 | },
|
54 | 54 | # NOTE: When modifying "purelib" scheme, update site._get_path() too.
|
55 | 55 | 'nt_user': {
|
56 |
| - 'stdlib': '{userbase}/Python{py_version_nodot}', |
57 |
| - 'platstdlib': '{userbase}/Python{py_version_nodot}', |
58 |
| - 'purelib': '{userbase}/Python{py_version_nodot}/site-packages', |
59 |
| - 'platlib': '{userbase}/Python{py_version_nodot}/site-packages', |
60 |
| - 'include': '{userbase}/Python{py_version_nodot}/Include', |
61 |
| - 'scripts': '{userbase}/Python{py_version_nodot}/Scripts', |
| 56 | + 'stdlib': '{userbase}/Python{py_version_nodot_plat}', |
| 57 | + 'platstdlib': '{userbase}/Python{py_version_nodot_plat}', |
| 58 | + 'purelib': '{userbase}/Python{py_version_nodot_plat}/site-packages', |
| 59 | + 'platlib': '{userbase}/Python{py_version_nodot_plat}/site-packages', |
| 60 | + 'include': '{userbase}/Python{py_version_nodot_plat}/Include', |
| 61 | + 'scripts': '{userbase}/Python{py_version_nodot_plat}/Scripts', |
62 | 62 | 'data': '{userbase}',
|
63 | 63 | },
|
64 | 64 | 'posix_user': {
|
@@ -149,10 +149,10 @@ def is_python_build(check_home=False):
|
149 | 149 | def _subst_vars(s, local_vars):
|
150 | 150 | try:
|
151 | 151 | return s.format(**local_vars)
|
152 |
| - except KeyError: |
| 152 | + except KeyError as var: |
153 | 153 | try:
|
154 | 154 | return s.format(**os.environ)
|
155 |
| - except KeyError as var: |
| 155 | + except KeyError: |
156 | 156 | raise AttributeError('{%s}' % var) from None
|
157 | 157 |
|
158 | 158 | def _extend_dict(target_dict, other_dict):
|
@@ -431,6 +431,7 @@ def _init_non_posix(vars):
|
431 | 431 | vars['EXE'] = '.exe'
|
432 | 432 | vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
|
433 | 433 | vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
|
| 434 | + vars['TZPATH'] = '' |
434 | 435 |
|
435 | 436 | #
|
436 | 437 | # public APIs
|
@@ -543,10 +544,13 @@ def get_config_vars(*args):
|
543 | 544 | except AttributeError:
|
544 | 545 | # sys.abiflags may not be defined on all platforms.
|
545 | 546 | _CONFIG_VARS['abiflags'] = ''
|
| 547 | + try: |
| 548 | + _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '') |
| 549 | + except AttributeError: |
| 550 | + _CONFIG_VARS['py_version_nodot_plat'] = '' |
546 | 551 |
|
547 | 552 | if os.name == 'nt':
|
548 | 553 | _init_non_posix(_CONFIG_VARS)
|
549 |
| - _CONFIG_VARS['TZPATH'] = '' |
550 | 554 | if os.name == 'posix':
|
551 | 555 | _init_posix(_CONFIG_VARS)
|
552 | 556 | # For backward compatibility, see issue19555
|
|
0 commit comments