Commit c8e62be
Giacomo De Lazzari
* Replace `os.system` with `subprocess.run`
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.
* Fix handling of compiler flags with whitespace at the ends
This is relative to the previous commit, and fixes the code in some
instances where the `args` list ended up with empty arguments or
arguments with trailing spaces.
* Fix flake8 lints
1 parent 2c93f3a commit c8e62be
1 file changed
+19
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
221 | | - | |
| 225 | + | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
0 commit comments