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
Prev Previous commit
Catch and ignore ValueError from relpath
  • Loading branch information
gvanrossum committed Jul 20, 2023
commit d35efab9a41109fa858cf0dc1f1e530c6768b1e1
13 changes: 9 additions & 4 deletions Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,15 @@ def write_function(
self.out.emit("")

def from_source_files(self) -> str:
paths = f"\n{self.out.comment} ".join(
prettify_filename(os.path.relpath(filename, ROOT))
for filename in self.input_filenames
)
filenames = []
for filename in self.input_filenames:
try:
filename = os.path.relpath(filename, ROOT)
except ValueError:
# May happen on Windows if root and temp on different volumes
pass
filenames.append(filename)
paths = f"\n{self.out.comment} ".join(filenames)
return f"{self.out.comment} from:\n{self.out.comment} {paths}\n"

def write_provenance_header(self):
Expand Down