Fix bug preventing compiler output from displaying

This commit is contained in:
klezVirus 2023-05-23 09:33:56 +01:00 committed by GitHub
parent 57722e7087
commit 6ad414f253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,9 +78,9 @@ class Compiler(ABC):
print(cmd)
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
if Config().get_boolean("DEBUG", "COMPILERS"):
print(output.decode())
print(output.decode(errors="replace"))
except subprocess.CalledProcessError as e:
for line in e.output.decode().split("\n"):
for line in e.output.decode(errors="replace").split("\n"):
if re.search(r"error", line, re.IGNORECASE):
print(f" [-] Error: {line}")
if re.search(r"warning", line, re.IGNORECASE):
@ -106,4 +106,4 @@ class Compiler(ABC):
@abstractmethod
def set_debug(self):
pass
pass