Skip to content

Commit 6852b20

Browse files
committed
Use os.path.isfile for checking if path.is_file, suppresses exceptions. Fixes #181.
1 parent faaf778 commit 6852b20

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

distutils/dist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def find_config_files(self):
334334
- a file named by an environment variable
335335
"""
336336
check_environ()
337-
files = [str(path) for path in self._gen_paths() if path.is_file()]
337+
files = [str(path) for path in self._gen_paths() if os.path.isfile(path)]
338338

339339
if DEBUG:
340340
self.announce("using config files: %s" % ', '.join(files))

distutils/tests/test_dist.py

-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def test_find_config_files_disable(self, temp_home):
258258
# make sure --no-user-cfg disables the user cfg file
259259
assert len(all_files) - 1 == len(files)
260260

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

0 commit comments

Comments
 (0)