mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1798660 - Drive-by: Use a better test for IsInDir. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D163301
This commit is contained in:
parent
65c94f1b70
commit
a837f93948
@ -314,10 +314,11 @@ else:
|
||||
|
||||
|
||||
def IsInDir(file, dir):
|
||||
# the lower() is to handle win32+vc8, where
|
||||
# the source filenames come out all lowercase,
|
||||
# but the srcdir can be mixed case
|
||||
return os.path.abspath(file).lower().startswith(os.path.abspath(dir).lower())
|
||||
try:
|
||||
Path(file).relative_to(dir)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def GetVCSFilenameFromSrcdir(file, srcdir):
|
||||
|
Loading…
Reference in New Issue
Block a user