From 1ed61d4b07d2113d403b0e70d7dbd373cd38151c Mon Sep 17 00:00:00 2001 From: Dave Bort Date: Tue, 14 May 2024 15:11:45 -0700 Subject: [PATCH] Ignore the FLATC_EXECUTABLE env var when empty We've seen some situations fail because flatc_path is an empty string. This seems like a likely culprit, but doesn't hurt either way. --- exir/_serialize/_flatbuffer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exir/_serialize/_flatbuffer.py b/exir/_serialize/_flatbuffer.py index 5efdb90f073..93006612c73 100644 --- a/exir/_serialize/_flatbuffer.py +++ b/exir/_serialize/_flatbuffer.py @@ -201,7 +201,9 @@ def _run_flatc(args: Sequence[str]) -> None: subprocess.run([flatc_path] + list(args), check=True) else: # Expect the `flatc` tool to be on the system path or set as an env var. - flatc_path = os.getenv("FLATC_EXECUTABLE", "flatc") + flatc_path = os.getenv("FLATC_EXECUTABLE") + if not flatc_path: + flatc_path = "flatc" subprocess.run([flatc_path] + list(args), check=True)