Commit d6deddd1 authored by Petr Špaček's avatar Petr Špaček

Deckard: Remove unused code for socket family and protocol fallback

The fallback for None values was never used so it was just rotting
and cluttering the code. Remove it!
parent 808d0f3d
......@@ -229,8 +229,8 @@ class TestServer:
def start_srv(self, address=None, family=socket.AF_INET, proto=socket.IPPROTO_UDP):
""" Starts listening thread if necessary """
if family == None:
family = socket.AF_INET
assert family
assert proto
if family == socket.AF_INET:
if address[0] is None:
address = (get_local_addr_str(family, self.default_iface), 53)
......@@ -243,8 +243,6 @@ class TestServer:
else:
raise NotImplementedError("[start_srv] unsupported protocol family {0}".format(family))
if proto == None:
proto = socket.IPPROTO_UDP
if proto == socket.IPPROTO_TCP:
socktype = socket.SOCK_STREAM
elif proto == socket.IPPROTO_UDP:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment