b/c...py: use subprocess.run instead of os.system
This commit is contained in:
parent
12b85ce454
commit
a66901b00d
@ -1,8 +1,9 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from os import system, environ, makedirs
|
from os import environ, makedirs
|
||||||
from os.path import exists, join as path_join
|
from os.path import exists, join as path_join
|
||||||
|
from shlex import split as command_line_split
|
||||||
from sys import stdin, exit
|
from sys import stdin, exit
|
||||||
from typing import Dict, Union
|
from typing import Dict, Union
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -229,7 +230,13 @@ if __name__ == "__main__":
|
|||||||
print("Compiling")
|
print("Compiling")
|
||||||
|
|
||||||
# Let the system execute aliases by calling os.system
|
# Let the system execute aliases by calling os.system
|
||||||
command = " ".join([CC, CFLAGS, INPUT_FILE, PATHS["fwrite_le"], "-o",
|
command = [
|
||||||
OUTPUT_FILE, "-I" + PATHS["include_directory"]])
|
CC,
|
||||||
print(command, flush=True)
|
*command_line_split(CFLAGS),
|
||||||
exit(system(command))
|
INPUT_FILE,
|
||||||
|
PATHS["fwrite_le"],
|
||||||
|
"-o", OUTPUT_FILE,
|
||||||
|
"-I" + PATHS["include_directory"]
|
||||||
|
]
|
||||||
|
print(" ".join(command), flush=True)
|
||||||
|
exit(subprocess.run(command).returncode)
|
||||||
|
Loading…
Reference in New Issue
Block a user