mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
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:
parent
af8d7e8524
commit
7ce2d6da4d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user