MCPcopy Create free account
hub / github.com/openai/openai-agents-python / interactive_shell_path

Function interactive_shell_path

examples/run_examples.py:182–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181@functools.lru_cache(maxsize=1)
182def interactive_shell_path() -> str | None:
183 shell = os.environ.get("SHELL")
184 if not shell:
185 return None
186
187 shell_name = Path(shell).name
188 if shell_name not in {"bash", "zsh"}:
189 return None
190
191 try:
192 result = subprocess.run(
193 [shell, "-lic", 'printf "%s" "$PATH"'],
194 capture_output=True,
195 check=True,
196 cwd=ROOT_DIR,
197 text=True,
198 )
199 except (OSError, subprocess.SubprocessError):
200 return None
201
202 path_value = result.stdout.strip()
203 return path_value or None
204
205
206def build_command_path(base_path: str | None = None) -> str:

Callers 1

build_command_pathFunction · 0.85

Calls 2

getMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected