_my_noproxy_list = []
def set_proxy_environ():
- global _my_noproxy, _my_proxies
if not _my_proxies:
return
for key in _my_proxies.keys():
ipint = 0
shift = 24
for dec in ip.split("."):
+ if not dec.isdigit():
+ continue
ipint |= int(dec) << shift
shift -= 8
return ipint
c_result = os.popen(cmd).readlines()
if len(c_result) == 0:
continue
- except Exception,e:
+ except Exception as e:
msger.warning(str(e))
continue
to_list = c_result[0].strip("\n").split(",")
shift = 24
netmask = 0
for dec in mask.split("."):
+ if not dec.isdigit():
+ continue
netmask |= int(dec) << shift
shift -= 8
ip &= netmask