def _parse_pid_from_output(self, output):
    try:
      # Parse the watchman pidfile from the cli output (in JSON).
      return json.loads(output)['pid']
    except __HOLE__:
      # JSON parse failure.
      self._logger.critical('invalid output from watchman!\n{output!s}'.format(output=output))
      raise self.InvalidCommandOutput(output)
    except KeyError:
      # Key access error on 'pid' - bad output from watchman.
      self._logger.critical('no pid from watchman!')
      raise self.InvalidCommandOutput(output)
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/pantsd/watchman.py/Watchman._parse_pid_from_output