Merge pull request #4380 from afedchin/win10

utils: winreg module may not exist like on windows universal platform.
This commit is contained in:
Cory Benfield
2017-11-27 20:39:15 +00:00
committed by GitHub
2 changed files with 9 additions and 4 deletions
+1
View File
@@ -16,6 +16,7 @@ dev
- Parsing empty ``Link`` headers with ``parse_header_links()`` no longer return one bogus entry
- Fixed issue where loading the default certificate bundle from a zip archive
would raise an ``IOError``
- Fixed issue with unexpected ``ImportError`` on windows system which do not support ``winreg`` module
2.18.4 (2017-08-15)
+8 -4
View File
@@ -45,10 +45,14 @@ if sys.platform == 'win32':
# provide a proxy_bypass version on Windows without DNS lookups
def proxy_bypass_registry(host):
if is_py3:
import winreg
else:
import _winreg as winreg
try:
if is_py3:
import winreg
else:
import _winreg as winreg
except ImportError:
return False
try:
internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')