Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import parser
from parser import StackEffect


HERE = os.path.dirname(__file__)
ROOT = os.path.join(HERE, "../..")
THIS = os.path.relpath(__file__, ROOT).replace(os.path.sep, posixpath.sep)
Expand Down Expand Up @@ -1154,7 +1155,7 @@ def write_function(

def from_source_files(self) -> str:
paths = f"\n{self.out.comment} ".join(
prettify_filename(filename)
prettify_filename(os.path.relpath(filename, ROOT))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests fail again with ValueError: path is on mount 'C:', start on mount 'D:' because of tempdir location.

I think we can solve this by using something like:

try:
    filename = os.path.relpath(filename, ROOT))
except ValueError:
    # This can happen if `filename` and `ROOT` are on different disks on Win:
    pass

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will do.

for filename in self.input_filenames
)
return f"{self.out.comment} from:\n{self.out.comment} {paths}\n"
Expand Down