Skip to content

Commit

Permalink
fix #111, chrome not installed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
John Lyu committed Oct 9, 2024
1 parent 77cbc07 commit 2aec126
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dataframe_image/converter/browser/chrome_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def get_chrome_path(chrome_path=None):
r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe",
]
for loc in locs:
handle = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, loc)
num_values = winreg.QueryInfoKey(handle)[1]
try:
handle = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, loc)
num_values = winreg.QueryInfoKey(handle)[1]
except FileNotFoundError:
num_values = 0
if num_values > 0:
return winreg.EnumValue(handle, 0)[1]
raise OSError("Cannot find chrome.exe on your windows machine")
Expand Down

0 comments on commit 2aec126

Please sign in to comment.