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", "rtti_scan", "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.
Expand Down
8 changes: 2 additions & 6 deletions tools/rtti_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from file_mode import published_mode # noqa: E402
from report_paths import same_report_path # noqa: E402



Expand Down Expand Up @@ -519,12 +520,7 @@ def main():
print(f"ERROR: {a.image}: does not exist", file=sys.stderr)
return 2
path = a.out or re.sub(r"\.(exe|dll)$", "", a.image, flags=re.I) + ".rtti.json"
same_path = os.path.normcase(os.path.realpath(a.image)) == os.path.normcase(os.path.realpath(path))
try:
same_path = same_path or os.path.samefile(a.image, path)
except OSError:
pass # A missing or inaccessible path is handled by the normal read/write error path.
if same_path:
if same_report_path(a.image, path):
ap.error("output must not overwrite the source image")
try:
with open(a.image, "rb") as f:
Expand Down