Fix scripts/check_system_python.py (#17629)

## Summary

Fix a bug in #17533 which was auto-merged despite failures.

## Test Plan

N/A (CI PR).
This commit is contained in:
Tomasz Kramkowski
2026-01-20 16:23:58 +00:00
committed by GitHub
parent cfd048aa7a
commit 6dd2c0ca4b
+8 -2
View File
@@ -82,11 +82,17 @@ if __name__ == "__main__":
if args.check_path:
process = subprocess.run(
["python", "-c", "import sys; print(sys.executable)"],
[
"python",
"-c",
"import os, sys; sys.stdout.buffer.write(os.fsencode(sys.executable))",
],
check=True,
stdout=subprocess.PIPE,
)
system_python_path = os.path.normcase(os.path.normpath(process.stdout))
system_python_path = os.path.normcase(
os.path.normpath(os.fsdecode(process.stdout))
)
our_python_path = os.path.normcase(os.path.normpath(sys.executable))
if our_python_path != system_python_path: