Skip to content

Commit

Permalink
Only rely on py_version_nodot_plat where not present (Python 3.9 and …
Browse files Browse the repository at this point in the history
…earlier).
  • Loading branch information
jaraco committed Jan 30, 2022
1 parent d16d759 commit 917046d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,19 @@ def finalize_options(self):
'implementation_lower': _get_implementation().lower(),
'implementation': _get_implementation(),
}
try:
local_vars['py_version_nodot_plat'] = sys.winver.replace('.', '')
except AttributeError:
local_vars['py_version_nodot_plat'] = ''

# vars for compatibility on older Pythons
compat_vars = dict(
# Python 3.9 and earlier
py_version_nodot_plat=getattr(sys, 'winver', '').replace('.', ''),
)

if HAS_USER_SITE:
local_vars['userbase'] = self.install_userbase
local_vars['usersite'] = self.install_usersite

self.config_vars = _collections.DictStack(
[sysconfig.get_config_vars(), local_vars])
[compat_vars, sysconfig.get_config_vars(), local_vars])

self.expand_basedirs()

Expand Down

0 comments on commit 917046d

Please sign in to comment.