File tree 2 files changed +5
-5
lines changed 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ def close(self) -> None:
94
94
class IPCClient (IPCBase ):
95
95
"""The client side of an IPC connection."""
96
96
97
- def __init__ (self , name : str , timeout : Optional [int ]) -> None :
97
+ def __init__ (self , name : str , timeout : Optional [float ]) -> None :
98
98
super ().__init__ (name )
99
99
if sys .platform == 'win32' :
100
- timeout = timeout or 0xFFFFFFFF # NMPWAIT_WAIT_FOREVER
100
+ timeout = int ( timeout * 1000 ) if timeout else 0xFFFFFFFF # NMPWAIT_WAIT_FOREVER
101
101
try :
102
102
_winapi .WaitNamedPipe (self .name , timeout )
103
103
except FileNotFoundError :
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def test_transaction_large(self) -> None:
28
28
p = Process (target = server , args = (msg , queue ), daemon = True )
29
29
p .start ()
30
30
connection_name = queue .get ()
31
- with IPCClient (connection_name , timeout = 1000 ) as client :
31
+ with IPCClient (connection_name , timeout = 1 ) as client :
32
32
assert client .read () == msg .encode ()
33
33
client .write (b'test' )
34
34
queue .close ()
@@ -41,11 +41,11 @@ def test_connect_twice(self) -> None:
41
41
p = Process (target = server , args = (msg , queue ), daemon = True )
42
42
p .start ()
43
43
connection_name = queue .get ()
44
- with IPCClient (connection_name , timeout = 1000 ) as client :
44
+ with IPCClient (connection_name , timeout = 1 ) as client :
45
45
assert client .read () == msg .encode ()
46
46
client .write (b'' ) # don't let the server hang up yet, we want to connect again.
47
47
48
- with IPCClient (connection_name , timeout = 1000 ) as client :
48
+ with IPCClient (connection_name , timeout = 1 ) as client :
49
49
assert client .read () == msg .encode ()
50
50
client .write (b'test' )
51
51
queue .close ()
You can’t perform that action at this time.
0 commit comments