Return true if the pathname refers to an existing directory.
(s)
| 47 | # This follows symbolic links, so both islink() and isdir() |
| 48 | # can be true for the same path on systems that support symlinks |
| 49 | def isdir(s): |
| 50 | """Return true if the pathname refers to an existing directory.""" |
| 51 | try: |
| 52 | st = os.stat(s) |
| 53 | except (OSError, ValueError): |
| 54 | return False |
| 55 | return stat.S_ISDIR(st.st_mode) |
| 56 | |
| 57 | |
| 58 | # Is a path a symbolic link? |
no test coverage detected
searching dependent graphs…