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

Function islink

Lib/genericpath.py:61–67  ·  view source on GitHub ↗

Test whether a path is a symbolic link

(path)

Source from the content-addressed store, hash-verified

59# This will always return false on systems where os.lstat doesn't exist.
60
61def islink(path):
62 """Test whether a path is a symbolic link"""
63 try:
64 st = os.lstat(path)
65 except (OSError, ValueError, AttributeError):
66 return False
67 return stat.S_ISLNK(st.st_mode)
68
69
70# Is a path a junction?

Callers 2

walkFunction · 0.85
_readlink_deepFunction · 0.85

Calls 1

lstatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…