diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-10-06 14:57:07 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-10 19:43:24 +0300 |
commit | a0a0c244e2a062ceba357f05d4852cd063f0b0cd (patch) | |
tree | 06ada5034b0d0aadc874f0e24b253286e6dbb635 /mesonbuild/backend/backends.py | |
parent | e9ba04537fa4e3e6215d89b363f98945dd62e389 (diff) | |
download | meson-a0a0c244e2a062ceba357f05d4852cd063f0b0cd.zip meson-a0a0c244e2a062ceba357f05d4852cd063f0b0cd.tar.gz meson-a0a0c244e2a062ceba357f05d4852cd063f0b0cd.tar.bz2 |
os.path.relpath() can fail on Windows
If builddir and sourcedir have different drive letters, a relative path
doesn't exist, and os.path.relpath fails with a ValueError exception.
This just fixes the places which are hit by test cases in a simple-minded
way. There are several other uses of os.path.relpath(), which might be
suspect.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 40ba213..28ef670 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -132,8 +132,8 @@ class Backend: self.build = build self.environment = build.environment self.processed_targets = {} - self.build_to_src = os.path.relpath(self.environment.get_source_dir(), - self.environment.get_build_dir()) + self.build_to_src = mesonlib.relpath(self.environment.get_source_dir(), + self.environment.get_build_dir()) def get_target_filename(self, t): if isinstance(t, build.CustomTarget): |