mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
host: Fix string literal
String literals are concatenated automatically in Python: assert 'a' 'b' == 'ab' This means that adding ' ' in the middle of a literal delimited by ' will be a no-op. Fix that by changing the literal delimiter to ".
This commit is contained in:
parent
d300b9e57f
commit
a948982700
@ -101,7 +101,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)
|
||||||
@ -119,7 +119,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 '.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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user