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

Function lexists

Lib/genericpath.py:27–33  ·  view source on GitHub ↗

Test whether a path exists. Returns True for broken symbolic links

(path)

Source from the content-addressed store, hash-verified

25
26# Being true for dangling symbolic links is also useful.
27def lexists(path):
28 """Test whether a path exists. Returns True for broken symbolic links"""
29 try:
30 os.lstat(path)
31 except (OSError, ValueError):
32 return False
33 return True
34
35# This follows symbolic links, so both islink() and isdir() can be true
36# for the same path on systems that support symlinks

Callers

nothing calls this directly

Calls 1

lstatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…