Simple implementation of the path protocol.
| 635 | |
| 636 | |
| 637 | class FakePath: |
| 638 | """Simple implementation of the path protocol. |
| 639 | """ |
| 640 | def __init__(self, path): |
| 641 | self.path = path |
| 642 | |
| 643 | def __repr__(self): |
| 644 | return f'<FakePath {self.path!r}>' |
| 645 | |
| 646 | def __fspath__(self): |
| 647 | if (isinstance(self.path, BaseException) or |
| 648 | isinstance(self.path, type) and |
| 649 | issubclass(self.path, BaseException)): |
| 650 | raise self.path |
| 651 | else: |
| 652 | return self.path |
| 653 | |
| 654 | |
| 655 | def fd_count(): |
no outgoing calls
searching dependent graphs…