Given a traversable dir, recursively replicate the whole tree to the file system in a context manager.
(path)
| 157 | |
| 158 | @contextlib.contextmanager |
| 159 | def _temp_dir(path): |
| 160 | """ |
| 161 | Given a traversable dir, recursively replicate the whole tree |
| 162 | to the file system in a context manager. |
| 163 | """ |
| 164 | assert path.is_dir() |
| 165 | with _temp_path(tempfile.TemporaryDirectory()) as temp_dir: |
| 166 | yield _write_contents(temp_dir, path) |
| 167 | |
| 168 | |
| 169 | def _write_contents(target, source): |
no test coverage detected
searching dependent graphs…