Fix relative backsteps.

This commit is contained in:
Ethan Dalool 2019-08-01 08:57:18 -07:00
parent 6a34c8eae9
commit d9d10a843e

View file

@ -149,7 +149,10 @@ class Path:
backsteps = other.depth - common.depth
backsteps = os.sep.join('..' for x in range(backsteps))
unique = self.absolute_path.replace(common.absolute_path, '')
common = common.absolute_path
if not common.endswith(os.sep):
common += os.sep
unique = self.absolute_path.replace(common, '', 1)
return os.path.join(backsteps, unique)
def replace_extension(self, extension):