diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..9dc30be6ec 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", "tile_probe", "vertex_types", "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/vertex_types.py b/tools/vertex_types.py index 39b133e704..1eb86865d3 100644 --- a/tools/vertex_types.py +++ b/tools/vertex_types.py @@ -47,6 +47,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from meshlet_page import PageError, parse_group # noqa: E402 (same group validation as the 63 30 pages) from report_paths import path_key # noqa: E402 +from report_paths import same_report_path # noqa: E402 MAGIC = 0x4042 HEADER = 0x80 @@ -679,15 +680,6 @@ def summarise(T): return out -def same_output_path(first, second): - 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 - - def _walk_error(exc: OSError): # os.walk skips a directory it cannot list unless onerror raises; a scan must not report an # incomplete directory as complete. main() turns the OSError into one error line and exit 2. @@ -729,7 +721,7 @@ def main(argv=None): print(f"error: --json {args.json} is a directory", file=sys.stderr) return 2 for path in archives.values(): - if same_output_path(args.json, path): + if same_report_path(args.json, path): print(f"error: --json would overwrite the input {path}", file=sys.stderr) return 2 rng = random.Random(args.seed)