From 798706fb988805a8fd06f12b1dbfa7fb95991cde Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:17 +0100 Subject: [PATCH 1/2] anim_clips: ask report_paths for the report-path guard --- tools/anim_clips.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/anim_clips.py b/tools/anim_clips.py index 35c2358842..fab6b4a359 100644 --- a/tools/anim_clips.py +++ b/tools/anim_clips.py @@ -45,6 +45,7 @@ from file_mode import published_mode # noqa: E402 from pool_workers import process_workers # noqa: E402 from replace_retry import replace as replace_retry # noqa: E402 +from report_paths import same_report_path # noqa: E402 SYSTEM = 0x50000000 CHANNEL_NAMES = ("static_quat", "static_vec3", "static_float", "raw_float", "quantize_float", @@ -1522,14 +1523,7 @@ def decode_one(path, offset, frames): return d -def same_output_path(first, second): - """True when writing ``second`` would truncate ``first`` (same file, path or hard link).""" - if os.path.normcase(os.path.realpath(first)) == os.path.normcase(os.path.realpath(second)): - return True - try: - return os.path.samefile(first, second) - except OSError: - return False +same_output_path = same_report_path # True when writing the second would truncate the first def main(): From f866b196c6a1b60a895600df73f24c89678bdce8 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:18 +0100 Subject: [PATCH 2/2] tests: list anim_clips in SHARED The reviewers' red test: with this entry on main, test_switched_tools_import_the_helper_and_define_no_copy fails with "'from report_paths import same_report_path' not found"; with this branch it passes. --- tests/test_report_paths.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..d8a14a603b 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -21,9 +21,9 @@ import report_paths # noqa: E402 # Tools that use report_paths and must not define their own copy again. -SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs", - "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index", - "world_lights_paths", "world_names") +SHARED = ("anim_clips", "anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", + "gen_d3d12_stubs", "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", + "world_index", "world_lights_paths", "world_names") # The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list: # import report_paths instead. LEGACY_COPIES = {"navmesh_decode"}