perf(test): cache bash probe resolution per session with functools.lru_cache

This commit is contained in:
Gracy769 authored and gaebal-gajae committed 2026-10-12 22:06:08 +00:00
1 parent 0d8b50b378
commit a916bf9d66
2 files changed
+8 -5

No files matched your search

+3
View File
@@ -1,3 +1,4 @@
import functools
import os
import shutil
import subprocess
@@ -5,6 +6,7 @@ import unittest
from pathlib import Path
@functools.lru_cache(maxsize=1)
def get_bash_executable() -> str | None:
if os.name == 'nt':
for candidate in (
@@ -21,6 +23,7 @@ def get_bash_executable() -> str | None:
return None
@functools.lru_cache(maxsize=1)
def require_bash() -> bool:
bash = get_bash_executable()
if not bash: