Skip to content
Snippets Groups Projects
Commit 0d7a0880 authored by Ayke van Laethem's avatar Ayke van Laethem Committed by Damien George
Browse files

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
parent 6572029d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment