Skip to content

Commit

Permalink
Ensure a missing target is still indicated as 'sources are newer' eve…
Browse files Browse the repository at this point in the history
…n when there are no sources.

Closes #284
  • Loading branch information
jaraco committed Aug 19, 2024
1 parent 9a9946f commit 30b7331
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion distutils/_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def missing_as_newer(source):
return missing == 'newer' and not os.path.exists(source)

ignored = os.path.exists if missing == 'ignore' else None
return any(
return not os.path.exists(target) or any(
missing_as_newer(source) or _newer(source, target)
for source in filter(ignored, sources)
)
Expand Down
1 change: 0 additions & 1 deletion distutils/tests/test_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def test_newer_pairwise_group(groups_target):
assert newer == ([groups_target.newer], [groups_target.target])


@pytest.mark.xfail(reason="pypa/distutils#284")
def test_newer_group_no_sources_no_target(tmp_path):
"""
Consider no sources and no target "newer".
Expand Down

0 comments on commit 30b7331

Please sign in to comment.