Skip to content

Commit 30b7331

Browse files
committed
Ensure a missing target is still indicated as 'sources are newer' even when there are no sources.
Closes #284
1 parent 9a9946f commit 30b7331

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Diff for: distutils/_modified.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def missing_as_newer(source):
6363
return missing == 'newer' and not os.path.exists(source)
6464

6565
ignored = os.path.exists if missing == 'ignore' else None
66-
return any(
66+
return not os.path.exists(target) or any(
6767
missing_as_newer(source) or _newer(source, target)
6868
for source in filter(ignored, sources)
6969
)

Diff for: distutils/tests/test_modified.py

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def test_newer_pairwise_group(groups_target):
119119
assert newer == ([groups_target.newer], [groups_target.target])
120120

121121

122-
@pytest.mark.xfail(reason="pypa/distutils#284")
123122
def test_newer_group_no_sources_no_target(tmp_path):
124123
"""
125124
Consider no sources and no target "newer".

0 commit comments

Comments
 (0)