diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..5038b4116c 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,7 +22,7 @@ # 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", + "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tex_headers", "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. diff --git a/tools/tex_headers.py b/tools/tex_headers.py index 4479822a29..bb6bd211ee 100644 --- a/tools/tex_headers.py +++ b/tools/tex_headers.py @@ -23,6 +23,9 @@ import sys from collections import Counter +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from report_paths import same_report_path # noqa: E402 + _UINT64_CODE = "Q" if array.array("Q").itemsize == 8 else None DXGI = { @@ -835,13 +838,10 @@ def scan_archive(carve, arch): 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 + """True when writing ``second`` would truncate ``first``: one name (case-folded on a folding volume) or one + file through a hard link. `tools/report_paths.same_report_path` owns that answer; this keeps the name the rest + of the tool calls.""" + return same_report_path(first, second) def input_files(carve, archs):