aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-10-23 18:45:06 +0300
committerGitHub <noreply@github.com>2019-10-23 18:45:06 +0300
commitae9723a5c1ef8fb8c46b4e07a91882644a85e389 (patch)
tree1a249f1d2d8c5868ded61b890d28c94dbb567d08 /mesonbuild/mesonlib.py
parent248a75ff4871cf8887280438a1fdf7b8f32084a2 (diff)
parent4857940e897ad2628cbd182b0632867b43cb4b25 (diff)
downloadmeson-ae9723a5c1ef8fb8c46b4e07a91882644a85e389.zip
meson-ae9723a5c1ef8fb8c46b4e07a91882644a85e389.tar.gz
meson-ae9723a5c1ef8fb8c46b4e07a91882644a85e389.tar.bz2
Merge pull request #5942 from scivision/duck
interpreter: raise Meson exception when non-found module is used anyway
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 1adc752..db7ac48 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -1389,13 +1389,13 @@ class BuildDirLock:
msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1)
self.lockfile.close()
-def relpath(path, start):
+def relpath(path: str, start: str) -> str:
# On Windows a relative path can't be evaluated for paths on two different
# drives (i.e. c:\foo and f:\bar). The only thing left to do is to use the
# original absolute path.
try:
return os.path.relpath(path, start)
- except ValueError:
+ except (TypeError, ValueError):
return path