From 17568553f760b4c64a097bb1dbad3d4eb254739b Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:02:25 -0400 Subject: [PATCH] FIX: Include file name in error message. Real helpful for actually fixing the thing. --- tools/check_python_h_first.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/check_python_h_first.py b/tools/check_python_h_first.py index 2e84b207cda4..4eaec1a6137b 100644 --- a/tools/check_python_h_first.py +++ b/tools/check_python_h_first.py @@ -87,7 +87,10 @@ def check_python_h_included_first(name_to_check: str) -> int: included_non_python_headers.append(i) if this_header in included_headers: - print(f"Header {this_header:s} included twice, second on line {i:d}", file=sys.stderr) + print( + f"Header {this_header:s} included twice in file {name_to_check:s}, second on line {i:d}", + file=sys.stderr + ) duplicate_header_count += 1 included_headers.append(this_header) elif (not included_python and not warned_python_construct and ".h" not in basename_to_check) and (