Skip to content

Commit

Permalink
Move 'str' cast into the one place where it's needed and allow config…
Browse files Browse the repository at this point in the history
…_vars to have None values.
  • Loading branch information
jaraco committed Dec 23, 2021
1 parent 9867e2e commit 56d267c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,7 @@ def finalize_options(self):
'platlibdir': getattr(sys, 'platlibdir', 'lib'),
'implementation_lower': _get_implementation().lower(),
'implementation': _get_implementation(),
# all values must be str; see #86
'platsubdir': str(sysconfig.get_config_var('platsubdir')),
'platsubdir': sysconfig.get_config_var('platsubdir'),
}

if HAS_USER_SITE:
Expand Down Expand Up @@ -650,7 +649,7 @@ def create_home_path(self):
return
home = convert_path(os.path.expanduser("~"))
for name, path in self.config_vars.items():
if path.startswith(home) and not os.path.isdir(path):
if str(path).startswith(home) and not os.path.isdir(path):
self.debug_print("os.makedirs('%s', 0o700)" % path)
os.makedirs(path, 0o700)

Expand Down

0 comments on commit 56d267c

Please sign in to comment.