Skip to content

Commit

Permalink
fix bug:#2192 can't run under win10
Browse files Browse the repository at this point in the history
  • Loading branch information
xxnet committed Mar 1, 2016
1 parent 262bc73 commit 3ec88b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python27/1.0/lib/win32/win32_proxy_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class INTERNET_PER_CONN_OPTION_LIST(Structure):
def disable_proxy():
_,values_num,_ = winreg.QueryInfoKey(CONNECTIONS)
for i in range(0, values_num):
key,value,_ = winreg.EnumValue(CONNECTIONS, i)
try:
key, value,_ = winreg.EnumValue(CONNECTIONS, i)
except:
break

List = INTERNET_PER_CONN_OPTION_LIST()
Option = (INTERNET_PER_CONN_OPTION * 1)()
Expand Down Expand Up @@ -122,7 +125,11 @@ def set_proxy(proxy_addr):
_,values_num,_ = winreg.QueryInfoKey(CONNECTIONS)
if values_num:
for i in range(0, values_num):
key,value,_ = winreg.EnumValue(CONNECTIONS, i)
try:
key,value,_ = winreg.EnumValue(CONNECTIONS, i)
except:
break

if '://' in proxy_addr:
set_proxy_auto(proxy_addr, key)
else:
Expand Down

0 comments on commit 3ec88b2

Please sign in to comment.