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.
This commit is contained in:
Sunny 2015-02-01 02:37:30 +08:00
parent 79b9b53dbe
commit a0aa9173a8

View file

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