73e25e7454f4d20be3513db3e6357efdc2425638,src/python/pants/pantsd/process_manager.py,ProcessManager,_wait_for_file,#ProcessManager#Any#Any#Any#,151

Before Change


    while 1:
      if os.path.exists(filename) and (not want_content or os.path.getsize(filename)): return

      if time.time() - start_time > timeout:
        raise self.Timeout("exceeded timeout of {sec} seconds while waiting for file {filename}"
                           .format(sec=timeout, filename=filename))
      else:
        time.sleep(self.WAIT_INTERVAL)

  def await_pid(self, timeout):
    Wait up to a given timeout for a process to launch.
    self._wait_for_file(self.get_pid_path(), timeout)
    return self._get_pid()

After Change


    def file_waiter():
      return os.path.exists(filename) and (not want_content or os.path.getsize(filename))

    try:
      return self._deadline_until(file_waiter, timeout)
    except self.Timeout:
      // Re-raise with a more helpful exception message.
      raise self.Timeout("exceeded timeout of {} seconds while waiting for file {} to appear"
                         .format(timeout, filename))

  def await_pid(self, timeout):
    Wait up to a given timeout for a process to launch.
    self._wait_for_file(self.get_pid_path(), timeout)
    return self._get_pid()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: 73e25e7454f4d20be3513db3e6357efdc2425638
Time: 2015-08-31
Author: kwilson@twopensource.com
File Name: src/python/pants/pantsd/process_manager.py
Class Name: ProcessManager
Method Name: _wait_for_file


Project Name: dickreuter/Poker
Commit Name: 2c986e4b250d8dbed032b9c98e732431045227b3
Time: 2016-11-15
Author: dickreuter@yahoo.com
File Name: table_analysers/table_screen_based.py
Class Name: TableScreenBased
Method Name: get_total_pot_value


Project Name: tensorflow/minigo
Commit Name: 6f6b0b30a04d95a26b297c219454bcd51f4f793e
Time: 2018-07-15
Author: andrew.m.jackson@gmail.com
File Name: rl_loop.py
Class Name:
Method Name: train