Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pypac/os_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ def autoconfig_url_from_registry():
winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
) as key:
return winreg.QueryValueEx(key, "AutoConfigURL")[0]
except WindowsError:
pass # Key or value not found.

try:
with winreg.OpenKey(
winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
) as key:
return winreg.QueryValueEx(key, "AutoConfigURL")[0]
except WindowsError:
return # Key or value not found.

Expand Down Expand Up @@ -108,3 +116,5 @@ def __init__(self):
class NotDarwinError(Exception):
def __init__(self):
super(NotDarwinError, self).__init__("Platform is not macOS/OSX.")


Loading