Skip to content

Commit

Permalink
fix msg order for reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Oct 9, 2024
1 parent fbcb674 commit 792f7ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/qtoolkit/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def generate_header(self, options: dict | QResources | None) -> str:
close_matches[extra_val] = m[0]
msg = (
f"The following keys are not present in the template: {', '.join(sorted(extra))}. "
f"Check the template in {type(self).__module__}.{type(self).__qualname__}.header_template"
f"Check the template in {type(self).__module__}.{type(self).__qualname__}.header_template."
)
if close_matches:
msg += "Possible replacements:"
for extra_val, match in close_matches.items():
msg += f" {match} instead of {extra_val}."
msg += " Possible replacements:"
for extra_val in sorted(close_matches):
msg += f" {close_matches[extra_val]} instead of {extra_val}."
raise ValueError(msg)

unclean_header = template.safe_substitute(options)
Expand Down

0 comments on commit 792f7ee

Please sign in to comment.