Skip to content

Commit

Permalink
gh-102781: fix cwd dependence in cases generator (#102782)
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Mar 17, 2023
1 parent 65fb7c4 commit 174c4bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ def __init__(
self.prefix = " " * indent
self.emit_line_directives = emit_line_directives
self.lineno = 1
filename = os.path.relpath(self.stream.name, ROOT)
# Make filename more user-friendly and less platform-specific
filename = self.stream.name.replace("\\", "/")
filename = filename.replace("\\", "/")
if filename.startswith("./"):
filename = filename[2:]
if filename.endswith(".new"):
Expand Down Expand Up @@ -567,6 +568,7 @@ def parse_file(self, filename: str, instrs_idx: dict[str, int]) -> None:
with open(filename) as file:
src = file.read()

filename = os.path.relpath(filename, ROOT)
# Make filename more user-friendly and less platform-specific
filename = filename.replace("\\", "/")
if filename.startswith("./"):
Expand Down

0 comments on commit 174c4bf

Please sign in to comment.