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

Function _follow_symlinks

Lib/platform.py:658–667  ·  view source on GitHub ↗

In case filepath is a symlink, follow it until a real file is reached.

(filepath)

Source from the content-addressed store, hash-verified

656 return default
657
658def _follow_symlinks(filepath):
659
660 """ In case filepath is a symlink, follow it until a
661 real file is reached.
662 """
663 filepath = os.path.abspath(filepath)
664 while os.path.islink(filepath):
665 filepath = os.path.normpath(
666 os.path.join(os.path.dirname(filepath), os.readlink(filepath)))
667 return filepath
668
669
670def _syscmd_file(target, default=''):

Callers 1

_syscmd_fileFunction · 0.85

Calls 5

islinkMethod · 0.80
abspathMethod · 0.45
joinMethod · 0.45
dirnameMethod · 0.45
readlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…