Fix timeout error in VariableServer.fromPID

After calculating the remaining timeout, make sure it's still
non-negative.

Refs #365
This commit is contained in:
Derek Bankieris 2017-02-08 08:32:23 -06:00
parent 29bdbee8fa
commit 3db5056db3

View File

@ -1003,6 +1003,8 @@ def fromPID(pid, timeout=None):
while True:
if timeout is not None:
timeout -= (time.time() - clock)
if timeout < 0:
raise socket.timeout
clock = time.time()
sock.settimeout(timeout)