tools/pyboard: Run exec: command as a string.
The Python documentation recommends to pass the command as a string when using Popen(..., shell=True). This is because "sh -c <string>" is used to execute the command and additional arguments after the command string are passed to the shell itself (not the executing command). https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen
This commit is contained in:
parent
6572029dc0
commit
0d7a088039
|
@ -152,7 +152,7 @@ class ProcessToSerial:
|
|||
|
||||
def __init__(self, cmd):
|
||||
import subprocess
|
||||
self.subp = subprocess.Popen(cmd.split(), bufsize=0, shell=True, preexec_fn=os.setsid,
|
||||
self.subp = subprocess.Popen(cmd, bufsize=0, shell=True, preexec_fn=os.setsid,
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
|
||||
# Initially was implemented with selectors, but that adds Python3
|
||||
|
|
Loading…
Reference in New Issue