MCPcopy Index your code
hub / github.com/RustPython/RustPython / FakePath

Class FakePath

Lib/test/support/os_helper.py:636–651  ·  view source on GitHub ↗

Simple implementation of the path protocol.

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls