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

Function _follow_symlinks

Lib/platform.py:703–712  ·  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

701 return default
702
703def _follow_symlinks(filepath):
704
705 """ In case filepath is a symlink, follow it until a
706 real file is reached.
707 """
708 filepath = os.path.abspath(filepath)
709 while os.path.islink(filepath):
710 filepath = os.path.normpath(
711 os.path.join(os.path.dirname(filepath), os.readlink(filepath)))
712 return filepath
713
714
715def _syscmd_file(target, default=''):

Callers 1

_syscmd_fileFunction · 0.85

Calls 3

islinkMethod · 0.80
joinMethod · 0.45
readlinkMethod · 0.45

Tested by

no test coverage detected