Commit 5014908
Giacomo De Lazzari
Replace
Besides being recommended by the Python documentation of `os.system()`
itself (https://docs.python.org/3/library/os.html#os.system), the
previous implementation with `os.system()` has the issue of not handling
paths with spaces, since the arguments like `program_path` and
`object_path` were concatenated as strings and then incorrectly parsed
by GCC in the presence of whitespace.
With `subprocess.run()`, we provide a list of arguments and the paths
are handled correctly. A small commented piece of code has been
introduced to build up an arguments list correctly.os.system with subprocess.run
1 parent 2c93f3a commit 5014908
1 file changed
+16
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
0 commit comments