File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ def close(self) -> None:
9494class IPCClient (IPCBase ):
9595 """The client side of an IPC connection."""
9696
97- def __init__ (self , name : str , timeout : Optional [int ]) -> None :
97+ def __init__ (self , name : str , timeout : Optional [float ]) -> None :
9898 super ().__init__ (name )
9999 if sys .platform == 'win32' :
100- timeout = timeout or 0xFFFFFFFF # NMPWAIT_WAIT_FOREVER
100+ timeout = int ( timeout * 1000 ) if timeout else 0xFFFFFFFF # NMPWAIT_WAIT_FOREVER
101101 try :
102102 _winapi .WaitNamedPipe (self .name , timeout )
103103 except FileNotFoundError :
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def test_transaction_large(self) -> None:
2828 p = Process (target = server , args = (msg , queue ), daemon = True )
2929 p .start ()
3030 connection_name = queue .get ()
31- with IPCClient (connection_name , timeout = 1000 ) as client :
31+ with IPCClient (connection_name , timeout = 1 ) as client :
3232 assert client .read () == msg .encode ()
3333 client .write (b'test' )
3434 queue .close ()
@@ -41,11 +41,11 @@ def test_connect_twice(self) -> None:
4141 p = Process (target = server , args = (msg , queue ), daemon = True )
4242 p .start ()
4343 connection_name = queue .get ()
44- with IPCClient (connection_name , timeout = 1000 ) as client :
44+ with IPCClient (connection_name , timeout = 1 ) as client :
4545 assert client .read () == msg .encode ()
4646 client .write (b'' ) # don't let the server hang up yet, we want to connect again.
4747
48- with IPCClient (connection_name , timeout = 1000 ) as client :
48+ with IPCClient (connection_name , timeout = 1 ) as client :
4949 assert client .read () == msg .encode ()
5050 client .write (b'test' )
5151 queue .close ()
You can’t perform that action at this time.
0 commit comments