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

Method _resolve_zip_path

Lib/importlib/resources/readers.py:165–174  ·  view source on GitHub ↗
(path_str: str)

Source from the content-addressed store, hash-verified

163
164 @staticmethod
165 def _resolve_zip_path(path_str: str):
166 for match in reversed(list(re.finditer(r'[\\/]', path_str))):
167 with contextlib.suppress(
168 FileNotFoundError,
169 IsADirectoryError,
170 NotADirectoryError,
171 PermissionError,
172 ):
173 inner = path_str[match.end() :].replace('\\', '/') + '/'
174 yield zipfile.Path(path_str[: match.start()], inner.lstrip('/'))
175
176 def resource_path(self, resource):
177 """

Callers 1

_candidate_pathsMethod · 0.80

Calls 7

reversedFunction · 0.85
listClass · 0.85
finditerMethod · 0.80
replaceMethod · 0.45
endMethod · 0.45
startMethod · 0.45
lstripMethod · 0.45

Tested by

no test coverage detected