From b2ff6bfd9f0a20685c0330525e9763871a03c785 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 30 Jul 2019 18:56:34 -0700 Subject: [PATCH] fix(library/relative.py): Windows and Linux builds --- library/relative.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/relative.py b/library/relative.py index 97f27e9a2c..de07b161ca 100644 --- a/library/relative.py +++ b/library/relative.py @@ -9,9 +9,9 @@ import re for x in sys.stdin: # HACK: rewrite Windows path to mingw path x = re.sub(r"^(\w):", lambda m: "/" + m[1].lower(), x).replace('\\', '/').strip() + curr = os.path.realpath(os.curdir) + curr = os.path.normpath(curr) if sys.platform == "darwin": # HACK: macos paths are case insensitive, but Python's normalization does not convert characters to lowercase - curr = os.path.realpath(os.curdir) - curr = os.path.normpath(curr) curr = curr.lower() print(os.path.relpath(x, curr))