Skip to content

Commit

Permalink
fix path issues on Windows in tools/report_score.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BR- committed Jan 24, 2024
1 parent 1d8b4f7 commit b125542
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/report_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List, Tuple, cast

import humanfriendly
from elftools.common.py3compat import sys
import sys
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection

Expand Down Expand Up @@ -59,12 +59,19 @@ def main(args) -> None:
"json",
f"{function['name']}",
]
result = subprocess.run(
proc = subprocess.run(
cmd,
executable=sys.executable,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
).stdout.strip()
)
if proc.returncode != 0:
print(" ".join(cmd), file=sys.stderr)
print(proc.stdout.strip(), file=sys.stderr)
print(proc.stderr.strip(), file=sys.stderr)
sys.exit(1)
result = proc.stdout.strip()
try:
result = json.loads(result)
current_score = int(result["current_score"])
Expand Down

0 comments on commit b125542

Please sign in to comment.