Browse Source

fix: change `is` to `==`, `is not` to `!=` after python3.8

dnomd343/master
dnomd343 3 years ago
parent
commit
4f9b01cc6c
  1. 6
      shadowsocks/common.py

6
shadowsocks/common.py

@ -265,7 +265,7 @@ class IPNetwork(object):
list(map(self.add_network, addrs))
def add_network(self, addr):
if addr is "":
if addr == "":
return
block = addr.split('/')
addr_family = is_ip(block[0])
@ -277,9 +277,9 @@ class IPNetwork(object):
ip = (hi << 64) | lo
else:
raise Exception("Not a valid CIDR notation: %s" % addr)
if len(block) is 1:
if len(block) == 1:
prefix_size = 0
while (ip & 1) == 0 and ip is not 0:
while (ip & 1) == 0 and ip != 0:
ip >>= 1
prefix_size += 1
logging.warn("You did't specify CIDR routing prefix size for %s, "

Loading…
Cancel
Save