diff --git a/isort/settings.py b/isort/settings.py index 0e8ae56be..7376004d8 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -389,8 +389,8 @@ def __init__( def is_skipped(self, file_path: Path) -> bool: """Returns True if the file and/or folder should be skipped based on current settings.""" - if self.directory and Path(self.directory) in file_path.parents: - file_name = os.path.relpath(file_path, self.directory) + if self.directory and Path(self.directory) in file_path.resolve().parents: + file_name = os.path.relpath(file_path.resolve(), self.directory) else: file_name = str(file_path)