diff options
author | Georg Brandl <georg@python.org> | 2009-04-01 04:28:33 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-01 04:28:33 (GMT) |
commit | 4ed72acd68a1a1d90946e189c94b7d656719da45 (patch) | |
tree | 37afeb94df477404291adfa1742f22cd7b39fb6f /Lib/urllib | |
parent | 99412e559bea9179394366a95ae1a2c1b0723c47 (diff) | |
download | cpython-4ed72acd68a1a1d90946e189c94b7d656719da45.zip cpython-4ed72acd68a1a1d90946e189c94b7d656719da45.tar.gz cpython-4ed72acd68a1a1d90946e189c94b7d656719da45.tar.bz2 |
#5624: _winreg is winreg in Python 3.
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 3e5b05c..59ec7b8 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2160,18 +2160,18 @@ elif os.name == 'nt': """ proxies = {} try: - import _winreg + import winreg except ImportError: # Std module, so should be around - but you never know! return proxies try: - internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, + internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') - proxyEnable = _winreg.QueryValueEx(internetSettings, + proxyEnable = winreg.QueryValueEx(internetSettings, 'ProxyEnable')[0] if proxyEnable: # Returned as Unicode but problems if not converted to ASCII - proxyServer = str(_winreg.QueryValueEx(internetSettings, + proxyServer = str(winreg.QueryValueEx(internetSettings, 'ProxyServer')[0]) if '=' in proxyServer: # Per-protocol settings @@ -2208,17 +2208,17 @@ elif os.name == 'nt': def proxy_bypass_registry(host): try: - import _winreg + import winreg import re except ImportError: # Std modules, so should be around - but you never know! return 0 try: - internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, + internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') - proxyEnable = _winreg.QueryValueEx(internetSettings, + proxyEnable = winreg.QueryValueEx(internetSettings, 'ProxyEnable')[0] - proxyOverride = str(_winreg.QueryValueEx(internetSettings, + proxyOverride = str(winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0]) # ^^^^ Returned as Unicode but problems if not converted to ASCII except WindowsError: |