diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..65549e099e 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,8 +22,8 @@ # 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") + "glb_inspect", "instance_lists", "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"} diff --git a/tools/instance_lists.py b/tools/instance_lists.py index 10e770b298..cead856576 100644 --- a/tools/instance_lists.py +++ b/tools/instance_lists.py @@ -37,6 +37,7 @@ from collections import Counter sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from report_paths import same_report_path # noqa: E402 import world_index as wi # noqa: E402 (same 0x7a header, schema and stream helpers) PROP_LIST, PROP_INST = 0xBA049770, 0xEA6B3A96 @@ -372,13 +373,7 @@ def scan(path, T, start=None, limit=None): pos = s + max(used, 1) -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 +same_output_path = same_report_path # True when writing the second would truncate the first def _int_arg(text):