doctor: normalize paths before comparing
Change-Id: I4e0f9fd2a7dcf942e6ce669528a8b6118ca9286e
diff --git a/pw_doctor/py/pw_doctor/doctor.py b/pw_doctor/py/pw_doctor/doctor.py
index 34a103d..d45fe05 100755
--- a/pw_doctor/py/pw_doctor/doctor.py
+++ b/pw_doctor/py/pw_doctor/doctor.py
@@ -79,13 +79,13 @@
@register_into(CHECKS)
def pw_root(ctx: DoctorContext):
"""Check that environment variable PW_ROOT is set and makes sense."""
- root = os.environ.get('PW_ROOT', None)
+ root = os.path.normpath(os.environ.get('PW_ROOT', None))
if root is None:
ctx.fatal('PW_ROOT not set')
- git_root = call_stdout(['git', 'rev-parse', '--show-toplevel'],
- cwd=root).strip()
+ git_root = os.path.normpath(
+ call_stdout(['git', 'rev-parse', '--show-toplevel'], cwd=root).strip())
if root != git_root:
ctx.error('PW_ROOT (%s) != `git rev-parse --show-toplevel` (%s)', root,
git_root)