MCPcopy Index your code
hub / github.com/python/cpython / FakePath

Class FakePath

Lib/test/support/os_helper.py:637–652  ·  view source on GitHub ↗

Simple implementation of the path protocol.

Source from the content-addressed store, hash-verified

635
636
637class 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
655def fd_count():

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…