def __onInterrupt(self): """ Handles the user interrupt of the process, i.e. kill the child and exit """ if self.__childPID is None: self.__onError("Unknown profiler child process, cannot kill it") return self.infoLabel.setText( "Killing profiler child process (pid: " + \ str( self.__childPID ) + ")..." ) try: killProcess(self.__childPID) except Exception, excpt: logging.error(str(excpt))
def __onInterrupt( self ): """ Handles the user interrupt of the process, i.e. kill the child and exit """ if self.__childPID is None: self.__onError( "Unknown profiler child process, cannot kill it" ) return self.infoLabel.setText( "Killing profiler child process (pid: " + \ str( self.__childPID ) + ")..." ) try: killProcess( self.__childPID ) except Exception, excpt: logging.error( str( excpt ) )
def __kill( self ): " Kills the process or checks there is no process in memory " if self.__proc is not None: try: self.__proc.kill() except: pass childPID = self.__getChildPID() while childPID is not None: try: # Throws an exception if cannot kill the process killProcess( childPID ) except: pass nextPID = self.__getChildPID() if nextPID == childPID: break childPID = nextPID # Here: the process killed self.wait() self.__proc = None return
def __kill(self): " Kills the process or checks there is no process in memory " if self.__proc is not None: try: self.__proc.kill() except: pass childPID = self.__getChildPID() while childPID is not None: try: # Throws an exception if cannot kill the process killProcess(childPID) except: pass nextPID = self.__getChildPID() if nextPID == childPID: break childPID = nextPID # Here: the process killed self.wait() self.__proc = None return