Change the current working directory to the specified path. Path can be a string or a path object.
(self, path: Union[str, "os.PathLike[str]"])
| 336 | invalidate_caches() |
| 337 | |
| 338 | def chdir(self, path: Union[str, "os.PathLike[str]"]) -> None: |
| 339 | """Change the current working directory to the specified path. |
| 340 | |
| 341 | Path can be a string or a path object. |
| 342 | """ |
| 343 | if self._cwd is None: |
| 344 | self._cwd = os.getcwd() |
| 345 | os.chdir(path) |
| 346 | |
| 347 | def undo(self) -> None: |
| 348 | """Undo previous changes. |