mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	host: remove unneeded concatenation
'{}'.format(x) + y is equivalent to '{}{}'.format(x, y)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							5b37dfc50b
						
					
				
				
					commit
					b1538fd184
				
			@@ -102,7 +102,7 @@ class LocalConnection(ConnectionBase):
 | 
				
			|||||||
            if self.unrooted:
 | 
					            if self.unrooted:
 | 
				
			||||||
                raise TargetStableError('unrooted')
 | 
					                raise TargetStableError('unrooted')
 | 
				
			||||||
            password = self._get_password()
 | 
					            password = self._get_password()
 | 
				
			||||||
            command = "echo {} | sudo -p ' ' -S -- sh -c ".format(quote(password)) + quote(command)
 | 
					            command = "echo {} | sudo -p ' ' -S -- sh -c {}".format(quote(password), quote(command))
 | 
				
			||||||
        ignore = None if check_exit_code else 'all'
 | 
					        ignore = None if check_exit_code else 'all'
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            stdout, stderr = check_output(command, shell=True, timeout=timeout, ignore=ignore)
 | 
					            stdout, stderr = check_output(command, shell=True, timeout=timeout, ignore=ignore)
 | 
				
			||||||
@@ -127,7 +127,7 @@ class LocalConnection(ConnectionBase):
 | 
				
			|||||||
            password = self._get_password()
 | 
					            password = self._get_password()
 | 
				
			||||||
            # The sudo prompt will add a space on stderr, but we cannot filter
 | 
					            # The sudo prompt will add a space on stderr, but we cannot filter
 | 
				
			||||||
            # it out here
 | 
					            # it out here
 | 
				
			||||||
            command = "echo {} | sudo -p ' ' -S ".format(quote(password)) + command
 | 
					            command = "echo {} | sudo -p ' ' -S -- {}".format(quote(password), command)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Make sure to get a new PGID so PopenBackgroundCommand() can kill
 | 
					        # Make sure to get a new PGID so PopenBackgroundCommand() can kill
 | 
				
			||||||
        # all sub processes that could be started without troubles.
 | 
					        # all sub processes that could be started without troubles.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user