aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-09-19 14:36:03 -0400
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-10-22 23:38:32 -0400
commit765a5e98358672f8c433145ee1642dabb75c7f7c (patch)
tree90d29cb46eb2e3fa58cad4488730f104a8494835 /mesonbuild/mesonlib.py
parentf96a8cbdf5ff3c8905d0d12442d0f9d378aeec13 (diff)
downloadmeson-765a5e98358672f8c433145ee1642dabb75c7f7c.zip
meson-765a5e98358672f8c433145ee1642dabb75c7f7c.tar.gz
meson-765a5e98358672f8c433145ee1642dabb75c7f7c.tar.bz2
ducking 'None' for missing module
This handles the Windows-specific case, the next commit handles the general issue
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