File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -112,12 +112,18 @@ def test_create_datagram_endpoint_sock(self):
112
112
assert False , 'Can not create socket.'
113
113
114
114
with sock :
115
- f = self .loop .create_datagram_endpoint (
116
- lambda : MyDatagramProto (loop = self .loop ), sock = sock )
117
- tr , pr = self .loop .run_until_complete (f )
118
- self .assertIsInstance (pr , MyDatagramProto )
119
- tr .close ()
120
- self .loop .run_until_complete (pr .done )
115
+ try :
116
+ f = self .loop .create_datagram_endpoint (
117
+ lambda : MyDatagramProto (loop = self .loop ), sock = sock )
118
+ except TypeError as ex :
119
+ # asyncio in 3.5.0 doesn't have the 'sock' argument
120
+ if 'got an unexpected keyword argument' not in ex .args [0 ]:
121
+ raise
122
+ else :
123
+ tr , pr = self .loop .run_until_complete (f )
124
+ self .assertIsInstance (pr , MyDatagramProto )
125
+ tr .close ()
126
+ self .loop .run_until_complete (pr .done )
121
127
122
128
123
129
class Test_UV_UDP (_TestUDP , tb .UVTestCase ):
You can’t perform that action at this time.
0 commit comments