diff --git a/distutils/_modified.py b/distutils/_modified.py index 6532aa10..b7bdaa29 100644 --- a/distutils/_modified.py +++ b/distutils/_modified.py @@ -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) ) diff --git a/distutils/tests/test_modified.py b/distutils/tests/test_modified.py index 4f1a7caf..e35cec2d 100644 --- a/distutils/tests/test_modified.py +++ b/distutils/tests/test_modified.py @@ -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".