tools: d3d12_switches and d3d12_run_fps set errors=replace on stdout

tests/test_tool_stdout_encoding.py asks it of every tool. d3d12_run_fps.py came
in with #2594 without it, which left that test red on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MoonEyes
2026-11-30 11:23:47 +01:00
parent 4c13169991
commit 6a321e5db4
2 changed files with 8 additions and 0 deletions

View File

@ -252,4 +252,8 @@ def main(argv=None) -> int:
if __name__ == "__main__":
try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
sys.exit(main())

View File

@ -320,4 +320,8 @@ def main(argv=None):
if __name__ == "__main__":
try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
sys.exit(main())