Test whether a path exists. Returns True for broken symbolic links
(path)
| 25 | |
| 26 | # Being true for dangling symbolic links is also useful. |
| 27 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…