Skip to content

Commit d45e365

Browse files
authored
python/tooling: Fix non-hermetic tool usage (#41782)
Signed-off-by: Ryan Northey <[email protected]>
1 parent 137df90 commit d45e365

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/code_format/check_format.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def __init__(self, path: str, args, source_path) -> None:
2929
self.path = path
3030
self.args = args
3131
self.source_path = source_path
32+
# This is also an ugly hack - we pull in these tools as python libs and
33+
# and then execute them - without the following it tries to use host python
34+
os.environ["PATH"] = f"{os.path.dirname(sys.executable)}:{os.environ['PATH']}"
3235

3336
def __getitem__(self, k):
3437
return self.config.__getitem__(k)

0 commit comments

Comments
 (0)