Skip to content

Commit

Permalink
Use os.path.isfile for checking if path.is_file, suppresses exceptions.
Browse files Browse the repository at this point in the history
Fixes #181.
  • Loading branch information
jaraco committed Sep 29, 2022
1 parent b1d4e77 commit 2c90ac8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def find_config_files(self):
- a file named by an environment variable
"""
check_environ()
files = [str(path) for path in self._gen_paths() if path.is_file()]
files = [str(path) for path in self._gen_paths() if os.path.isfile(path)]

if DEBUG:
self.announce("using config files: %s" % ', '.join(files))
Expand Down
1 change: 0 additions & 1 deletion distutils/tests/test_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def test_find_config_files_disable(self, temp_home):
# make sure --no-user-cfg disables the user cfg file
assert len(all_files) - 1 == len(files)

@pytest.mark.xfail(reason="pypa/distutils#181", strict=True)
@pytest.mark.skipif(
'platform.system() == "Windows"',
'Windows does not honor chmod 000',
Expand Down

0 comments on commit 2c90ac8

Please sign in to comment.