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

Method realpath

Lib/test/test_getpath.py:1032–1044  ·  view source on GitHub ↗
(self, path, _trail=None)

Source from the content-addressed store, hash-verified

1030 raise FileNotFoundError(path) from None
1031
1032 def realpath(self, path, _trail=None):
1033 if verbose:
1034 print("Read link from", path)
1035 try:
1036 link = self._links[path.casefold()]
1037 except KeyError:
1038 return path
1039 if _trail is None:
1040 _trail = set()
1041 elif link.casefold() in _trail:
1042 raise OSError("circular link")
1043 _trail.add(link.casefold())
1044 return self.realpath(link, _trail)
1045
1046 def warn(self, message):
1047 self._warnings.append(message)

Callers 15

getmoduleFunction · 0.45
_url_handlerFunction · 0.45
_get_filtered_attrsFunction · 0.45
_safe_realpathMethod · 0.45
__init__Method · 0.45
libc_verFunction · 0.45
resolveMethod · 0.45
_find_test_pathMethod · 0.45
_split_python_pathMethod · 0.45
test_base_interpreterMethod · 0.45
_make_pkgMethod · 0.45
test_executableMethod · 0.45

Calls 3

setFunction · 0.85
casefoldMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected