Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_report_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 2 additions & 10 deletions tools/vertex_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
Loading