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

Function isdir

Lib/genericpath.py:49–55  ·  view source on GitHub ↗

Return true if the pathname refers to an existing directory.

(s)

Source from the content-addressed store, hash-verified

47# This follows symbolic links, so both islink() and isdir()
48# can be true for the same path on systems that support symlinks
49def 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?

Callers 2

realpathFunction · 0.85
getpath.pyFile · 0.85

Calls 1

statMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…