MCPcopy Create free account
hub / github.com/qilingframework/qiling / __strip_parent_refs

Method __strip_parent_refs

qiling/os/path.py:54–64  ·  view source on GitHub ↗

Strip leading parent dir references, if any.

(path: AnyPurePath)

Source from the content-addressed store, hash-verified

52
53 @staticmethod
54 def __strip_parent_refs(path: AnyPurePath) -> AnyPurePath:
55 """Strip leading parent dir references, if any.
56 """
57
58 if path.parts:
59 pardir = r'..'
60
61 while path.parts[0] == pardir:
62 path = path.relative_to(pardir)
63
64 return path
65
66 @property
67 def root(self) -> str:

Callers 2

cwdMethod · 0.80
__virtual_abspathMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected