Bug 1704764: Remove OSError catch for fetching nonexistent registry key r=sheehan

Since Python 3, attempting to fetch a registry key that doesn't exist
throws `FileNotFoundError`, not `WindowsError: [Error 2]`.

Differential Revision: https://phabricator.services.mozilla.com/D112647
This commit is contained in:
Mitchell Hentges 2021-04-27 20:16:14 +00:00
parent af8d7e8524
commit 7ce2d6da4d

View File

@ -51,7 +51,7 @@ def get_is_windefender_disabled():
)
# is_antivirus_disabled is either 0 (False) or 1 (True)
return bool(is_antivirus_disabled)
except (FileNotFoundError, OSError):
except FileNotFoundError:
return True
@ -68,7 +68,7 @@ def get_windefender_exclusion_paths():
for i in range(0, values_count):
path, _, __ = winreg.EnumValue(exclusions_key, i)
paths.append(path)
except (FileNotFoundError, OSError):
except FileNotFoundError:
pass
return paths