ducking 'None' for missing module

This handles the Windows-specific case, the next commit handles the general issue
This commit is contained in:
Michael Hirsch, Ph.D 2019-09-19 14:36:03 -04:00
parent f96a8cbdf5
commit 765a5e9835
No known key found for this signature in database
GPG Key ID: 6D23CDADAB0294F9
1 changed files with 2 additions and 2 deletions

View File

@ -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