Given a Traversable object, return that object as a path on the local file system in a context manager.
(path)
| 164 | |
| 165 | @functools.singledispatch |
| 166 | def as_file(path): |
| 167 | """ |
| 168 | Given a Traversable object, return that object as a |
| 169 | path on the local file system in a context manager. |
| 170 | """ |
| 171 | return _temp_dir(path) if _is_present_dir(path) else _temp_file(path) |
| 172 | |
| 173 | |
| 174 | @as_file.register(pathlib.Path) |
no test coverage detected