From 92b84bdc0e4a65f7cfc82e65e80c019fb551338f Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 28 Jul 2020 21:39:47 -0700 Subject: [PATCH] Improve handling of relative path detection --- isort/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)