mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	connection: Un-hardcode _KILL_TIMEOUT
Replace erroneous use of _KILL_TIMEOUT constant by the kill_timeout parameter.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							6cabad14d0
						
					
				
				
					commit
					4e44863777
				
			@@ -221,7 +221,7 @@ class PopenBackgroundCommand(BackgroundCommand):
 | 
			
		||||
        popen = self.popen
 | 
			
		||||
        os.killpg(os.getpgid(popen.pid), signal.SIGTERM)
 | 
			
		||||
        try:
 | 
			
		||||
            popen.wait(timeout=_KILL_TIMEOUT)
 | 
			
		||||
            popen.wait(timeout=kill_timeout)
 | 
			
		||||
        except subprocess.TimeoutExpired:
 | 
			
		||||
            os.killpg(os.getpgid(popen.pid), signal.SIGKILL)
 | 
			
		||||
 | 
			
		||||
@@ -351,7 +351,7 @@ class AdbBackgroundCommand(BackgroundCommand):
 | 
			
		||||
    def _cancel(self, kill_timeout):
 | 
			
		||||
        self.send_signal(signal.SIGTERM)
 | 
			
		||||
        try:
 | 
			
		||||
            self.adb_popen.wait(timeout=_KILL_TIMEOUT)
 | 
			
		||||
            self.adb_popen.wait(timeout=kill_timeout)
 | 
			
		||||
        except subprocess.TimeoutExpired:
 | 
			
		||||
            self.send_signal(signal.SIGKILL)
 | 
			
		||||
            self.adb_popen.kill()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user