From d3f5cccdb2f9faca8ba02423e81fbdebc0ec9af4 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 20 Oct 2021 23:08:48 -0600 Subject: [PATCH] Update disable_chrome_notifications() --- scripts/wk/setup/win.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/wk/setup/win.py b/scripts/wk/setup/win.py index 43eef7e1..0e4b9165 100644 --- a/scripts/wk/setup/win.py +++ b/scripts/wk/setup/win.py @@ -535,13 +535,12 @@ def disable_chrome_notifications(): """Disable notifications in Google Chrome.""" defaults_key = 'default_content_setting_values' profiles = [] - search_path = case_insensitive_path( - f'{os.environ.get("LOCALAPPDATA")}/Google/Chrome/User Data', - ) - - # Bail early - if not search_path: - raise GenericWarning('No profiles detected.') + try: + search_path = case_insensitive_path( + f'{os.environ.get("LOCALAPPDATA")}/Google/Chrome/User Data', + ) + except FileNotFoundError as err: + raise GenericWarning('No profiles detected.') from err # Close any running instances of Chrome kill_procs('chrome.exe', force=True)