parameters: (self)
docstring: Force the termination of Webots.
docstring_summary: Force the termination of Webots.
docstring_tokens: Force the termination of Webots .
function: def kill_webots(self):
          """Force the termination of Webots."""
          if self.webots_process:
              logging.warning('[%d] Webots [%d] was killed' % (id(self), self.webots_process.pid))
              if sys.platform == 'darwin':
                  self.webots_process.kill()
              else:
                  self.webots_process.terminate()
                  try:
                      self.webots_process.wait(5)  # set a timeout (seconds) to avoid blocking the whole script
                  except subprocess.TimeoutExpired:
                      logging.warning('[%d] ERROR killing Webots [%d]' % (id(self), self.webots_process.pid))
                      self.webots_process.kill()
              self.webots_process = None
function_tokens: def kill_webots ( self ) : if self . webots_process : logging . warning ( '[%d] Webots [%d] was killed' % ( id ( self ) , self . webots_process . pid ) ) if sys . platform == 'darwin' : self . webots_process . kill ( ) else : self . webots_process . terminate ( ) try : self . webots_process . wait ( 5 ) # set a timeout (seconds) to avoid blocking the whole script except subprocess . TimeoutExpired : logging . warning ( '[%d] ERROR killing Webots [%d]' % ( id ( self ) , self . webots_process . pid ) ) self . webots_process . kill ( ) self . webots_process = None