prepare_report.py: Prevent Windows-style paths from ending up in the bytecode report

This commit is contained in:
Kamil Śliwak 2021-01-19 17:40:53 +01:00
parent ead1a26f21
commit ba6acae240

View File

@ -27,7 +27,7 @@ class FileReport:
report = ""
if self.contract_reports is None:
return f"{self.file_name}: <ERROR>\n"
return f"{self.file_name.as_posix()}: <ERROR>\n"
for contract_report in self.contract_reports:
bytecode = contract_report.bytecode if contract_report.bytecode is not None else '<NO BYTECODE>'
@ -35,8 +35,8 @@ class FileReport:
# NOTE: Ignoring contract_report.file_name because it should always be either the same
# as self.file_name (for Standard JSON) or just the '<stdin>' placeholder (for CLI).
report += f"{self.file_name}:{contract_report.contract_name} {bytecode}\n"
report += f"{self.file_name}:{contract_report.contract_name} {metadata}\n"
report += f"{self.file_name.as_posix()}:{contract_report.contract_name} {bytecode}\n"
report += f"{self.file_name.as_posix()}:{contract_report.contract_name} {metadata}\n"
return report