From b8aaecd15f6e741cf0e50348bc660dad5804fb14 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 1 Aug 2019 08:47:04 -0700 Subject: [PATCH] Move case correction to after self==other check. --- voussoirkit/pathclass.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index 4d6f35b..2593e0f 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -122,12 +122,13 @@ class Path: def relative_to(self, other): other = Path(other) - other.correct_case() - self.correct_case() if self == other: return '.' + self.correct_case() + other.correct_case() + if self in other: relative = self.absolute_path relative = relative.replace(other.absolute_path, '', 1)