@@ -173,6 +173,8 @@ def joinuser(*args):
173173_SCHEME_KEYS = ('stdlib' , 'platstdlib' , 'purelib' , 'platlib' , 'include' ,
174174 'scripts' , 'data' )
175175
176+ _PY_VERSION_SHORT = f'{ sys .version_info [0 ]} .{ sys .version_info [1 ]} '
177+ _PY_VERSION_SHORT_NO_DOT = f'{ sys .version_info [0 ]} { sys .version_info [1 ]} '
176178_BASE_PREFIX = os .path .normpath (sys .base_prefix )
177179_BASE_EXEC_PREFIX = os .path .normpath (sys .base_exec_prefix )
178180# Mutex guarding initialization of _CONFIG_VARS.
@@ -321,8 +323,7 @@ def get_makefile_filename():
321323 return os .path .join (_PROJECT_BASE , "Makefile" )
322324
323325 if hasattr (sys , 'abiflags' ):
324- py_version_short = f'{ sys .version_info [0 ]} .{ sys .version_info [1 ]} '
325- config_dir_name = f'config-{ py_version_short } { sys .abiflags } '
326+ config_dir_name = f'config-{ _PY_VERSION_SHORT } { sys .abiflags } '
326327 else :
327328 config_dir_name = 'config'
328329
@@ -405,7 +406,7 @@ def _init_non_posix(vars):
405406 vars ['LIBRARY' ] = os .path .basename (_safe_realpath (dllhandle ))
406407 vars ['LDLIBRARY' ] = vars ['LIBRARY' ]
407408 vars ['EXE' ] = '.exe'
408- vars ['VERSION' ] = vars [ 'py_version_nodot' ]
409+ vars ['VERSION' ] = _PY_VERSION_SHORT_NO_DOT
409410 vars ['BINDIR' ] = os .path .dirname (_safe_realpath (sys .executable ))
410411 # No standard path exists on Windows for this, but we'll check
411412 # whether someone is imitating a POSIX-like layout
@@ -529,6 +530,8 @@ def _init_config_vars():
529530 # Distutils.
530531 _CONFIG_VARS ['prefix' ] = prefix
531532 _CONFIG_VARS ['exec_prefix' ] = exec_prefix
533+ _CONFIG_VARS ['py_version_short' ] = _PY_VERSION_SHORT
534+ _CONFIG_VARS ['py_version_nodot' ] = _PY_VERSION_SHORT_NO_DOT
532535 _CONFIG_VARS ['installed_base' ] = base_prefix
533536 _CONFIG_VARS ['base' ] = prefix
534537 _CONFIG_VARS ['installed_platbase' ] = base_exec_prefix
@@ -735,11 +738,11 @@ def get_platform():
735738
736739
737740def get_python_version ():
738- return get_config_var ( 'py_version_short' )
741+ return _PY_VERSION_SHORT
739742
740743
741744def _get_python_version_abi ():
742- return get_config_var ( 'py_version_short' ) + get_config_var (' abi_thread' )
745+ return _PY_VERSION_SHORT + get_config_var (" abi_thread" )
743746
744747
745748def expand_makefile_vars (s , vars ):
0 commit comments