Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
deadline = time.time() + self.start_timeout
while time.time() < deadline:
try:
client = pywatchman.client(sockpath=self.sock_file)
self.pid = client.query("get-pid")["pid"]
break
except pywatchman.SocketConnectError:
t, val, tb = sys.exc_info()
time.sleep(0.1)
finally:
client.close()
if self.pid is None:
# self.proc didn't come up: wait for it to die
self.stop()
pywatchman.compat.reraise(t, val, tb)