1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-26 04:33:47 +00:00

Optimize subprocess performance with close_fds=False (#10145)

This commit is contained in:
J. Nick Koston
2025-08-10 16:14:13 -05:00
committed by GitHub
parent 279f56141e
commit 5a8f722316
12 changed files with 40 additions and 13 deletions

View File

@@ -17,7 +17,9 @@ _LOGGER = logging.getLogger(__name__)
def run_git_command(cmd, cwd=None) -> str:
_LOGGER.debug("Running git command: %s", " ".join(cmd))
try:
ret = subprocess.run(cmd, cwd=cwd, capture_output=True, check=False)
ret = subprocess.run(
cmd, cwd=cwd, capture_output=True, check=False, close_fds=False
)
except FileNotFoundError as err:
raise cv.Invalid(
"git is not installed but required for external_components.\n"