|
|
|
@ -1930,14 +1930,14 @@ class OrderedSet(T.MutableSet[_T]): |
|
|
|
|
for item in iterable: |
|
|
|
|
self.discard(item) |
|
|
|
|
|
|
|
|
|
def relpath(path: str, start: str) -> str: |
|
|
|
|
def relpath(path: T.Union[str, Path], start: T.Union[str, Path]) -> str: |
|
|
|
|
# On Windows a relative path can't be evaluated for paths on two different |
|
|
|
|
# drives (i.e. c:\foo and f:\bar). The only thing left to do is to use the |
|
|
|
|
# original absolute path. |
|
|
|
|
try: |
|
|
|
|
return os.path.relpath(path, start) |
|
|
|
|
except (TypeError, ValueError): |
|
|
|
|
return path |
|
|
|
|
return str(path) |
|
|
|
|
|
|
|
|
|
def path_is_in_root(path: Path, root: Path, resolve: bool = False) -> bool: |
|
|
|
|
# Check whether a path is within the root directory root |
|
|
|
|