MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / working_directory

Function working_directory

scripts/build_cpp_examples.py:13–20  ·  view source on GitHub ↗

Changes working directory and returns to previous on exit.

(path: PathLike)

Source from the content-addressed store, hash-verified

11
12@contextlib.contextmanager
13def working_directory(path: PathLike):
14 """Changes working directory and returns to previous on exit."""
15 prev_cwd = Path.cwd()
16 os.chdir(path)
17 try:
18 yield
19 finally:
20 os.chdir(prev_cwd)
21
22
23def build_cpp_examples(build_dir: PathLike, trt_dir: PathLike,

Callers 1

build_cpp_examplesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected