@@ -42,7 +42,7 @@ struct PythonTCPListener:
4242 self .socket = socket
4343
4444 @always_inline
45- fn accept [ T : Connection] (self ) raises -> T :
45+ fn accept (self ) raises -> PythonConnection :
4646 var conn_addr = self .socket.accept()
4747 return PythonConnection(self .__pymodules, conn_addr)
4848
@@ -55,16 +55,16 @@ struct PythonTCPListener:
5555 return self .__addr
5656
5757
58- struct PythonListenConfig ( ListenConfig ) :
58+ struct PythonListenConfig :
5959 var __pymodules : Modules
6060 var __keep_alive : Duration
6161
62- fn __init__ (inout self ) raises :
63- self .__keep_alive = Duration( default_tcp_keep_alive)
62+ fn __init__ (inout self ):
63+ self .__keep_alive = default_tcp_keep_alive
6464 self .__pymodules = Modules()
6565
66- fn __init__ (inout self , keep_alive : Duration) raises :
67- self .__keep_alive = Duration( keep_alive)
66+ fn __init__ (inout self , keep_alive : Duration):
67+ self .__keep_alive = keep_alive
6868 self .__pymodules = Modules()
6969
7070 fn listen (inout self , network : String, address : String) raises -> PythonTCPListener:
@@ -132,14 +132,11 @@ struct PythonConnection(Connection):
132132 return TCPAddr(self .raddr[0 ].__str__ (), self .raddr[1 ].__int__ ())
133133
134134
135- struct PythonNet ( Net ) :
135+ struct PythonNet :
136136 var __lc : PythonListenConfig
137137
138138 fn __init__ (inout self ):
139- try :
140- self .__lc = PythonListenConfig(default_tcp_keep_alive)
141- except e:
142- print (" Could not initialize PythonListenConfig: " + e.__str__ ())
139+ self .__lc = PythonListenConfig(default_tcp_keep_alive)
143140
144141 fn __init__ (inout self , keep_alive : Duration) raises :
145142 self .__lc = PythonListenConfig(keep_alive)
0 commit comments