Add asserts for path variable types

This commit is contained in:
hp310780 2021-10-31 16:27:47 +00:00
parent dd2584c894
commit c718c65849
1 changed files with 2 additions and 0 deletions

View File

@ -685,6 +685,8 @@ def bestrelpath(directory: Path, dest: Path) -> str:
If no such path can be determined, returns dest.
"""
assert isinstance(directory, Path)
assert isinstance(dest, Path)
if dest == directory:
return os.curdir
# Find the longest common directory.