Skip to content

Commit 6c224d3

Browse files
authored
Merge pull request pypa/distutils#278 from cj81499/handle-failure-to-find-user-home
handle failures to find a user home directory
2 parents 2e8c2a2 + a13507c commit 6c224d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

distutils/dist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ def _gen_paths(self):
346346
prefix = '.' * (os.name == 'posix')
347347
filename = prefix + 'pydistutils.cfg'
348348
if self.want_user_cfg:
349-
yield pathlib.Path('~').expanduser() / filename
349+
with contextlib.suppress(RuntimeError):
350+
yield pathlib.Path('~').expanduser() / filename
350351

351352
# All platforms support local setup.cfg
352353
yield pathlib.Path('setup.cfg')

0 commit comments

Comments
 (0)