Browse Source

Fix for Python3 map changed behavior

In Python3, map returns an iterator instead of list in Python2,
which cause map "lazier" than before, wrap with list() force it running.
master
Sunny 10 years ago
parent
commit
a0aa9173a8
  1. 2
      shadowsocks/common.py

2
shadowsocks/common.py

@ -192,7 +192,7 @@ class IPNetwork(object):
self._network_list_v6 = [] self._network_list_v6 = []
if type(addrs) == str: if type(addrs) == str:
addrs = addrs.split(',') addrs = addrs.split(',')
map(self.add_network, addrs) list(map(self.add_network, addrs))
def add_network(self, addr): def add_network(self, addr):
if addr is "": if addr is "":

Loading…
Cancel
Save