Bug 1659615 - handle the fact Windows Defender might have exclusions on different disks. r=mhentges,froydnj

Differential Revision: https://phabricator.services.mozilla.com/D87382
This commit is contained in:
Mark Hammond 2020-08-18 11:28:50 +00:00
parent 7f71e11e00
commit b0ffe6a42b

View File

@ -126,9 +126,13 @@ def is_windefender_affecting_srcdir(srcdir):
srcdir = os.path.normcase(os.path.abspath(srcdir))
for exclusion_path in get_windefender_exclusion_paths():
exclusion_path = os.path.normcase(os.path.abspath(exclusion_path))
if os.path.commonpath([exclusion_path, srcdir]) == exclusion_path:
# exclusion_path is an ancestor of srcdir
return False
try:
if os.path.commonpath([exclusion_path, srcdir]) == exclusion_path:
# exclusion_path is an ancestor of srcdir
return False
except ValueError:
# ValueError: Paths don't have the same drive - can't be ours
pass
return True