Skip to content

Commit ecdd565

Browse files
committed
Document checkfile()
1 parent 17e43fd commit ecdd565

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vdirsyncer/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,13 @@ def checkdir(path: str, create: bool = False, mode: int = 0o750) -> None:
127127
raise exceptions.CollectionNotFound(f"Directory {path} does not exist.")
128128

129129

130-
def checkfile(path, create=False):
131-
"""
132-
Check whether ``path`` is a file.
130+
def checkfile(path, create=False) -> None:
131+
"""Check whether ``path`` is a file.
133132
134133
:param create: Whether to create the file's parent directories if they do
135134
not exist.
135+
:raises CollectionNotFound: if path does not exist.
136+
:raises OSError: if path exists but is not a file.
136137
"""
137138
checkdir(os.path.dirname(path), create=create)
138139
if not os.path.isfile(path):

0 commit comments

Comments
 (0)