8000 gh-107614: Normalise Argument Clinic error messages by erlend-aasland · Pull Request #107615 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-107614: Normalise Argument Clinic error messages #107615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
Next Next commit
Apply suggestions from code review
  • Loading branch information
AlexWaygood authored and erlend-aasland committed Aug 4, 2023
commit 31f1e22f25882d519fe8cb273884ff605119b608
2 changes: 1 addition & 1 deletion Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,7 @@ def test_file_dest(self):
f.write("") # Write an empty output file!
# Clinic should complain about the empty output file.
_, err = self.expect_failure(in_fn)
expected_err = (f"Modified destination file {out_fn!r}, "
expected_err = (f"Modified destination file {out_fn!r}; "
"not overwriting!")
self.assertIn(expected_err, err)
# Run clinic again, this time with the -f option.
Expand Down
6 changes: 3 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ def __repr__(self) -> str:

def clear(self) -> None:
if self.type != 'buffer':
fail(f"Can't clear destination {self.name!r}, it's not of type buffer")
fail(f"Can't clear destination {self.name!r}: it's not of type buffer")
self.buffers.clear()

def dump(self) -> str:
Expand Down Expand Up @@ -2277,15 +2277,15 @@ def parse(self, input: str) -> str:
except FileExistsError:
if not os.path.isdir(dirname):
662A fail(f"Can't write to destination "
f"{destination.filename!r}, "
f"{destination.filename!r}; "
f"can't make directory {dirname!r}!")
if self.verify:
with open(destination.filename) as f:
parser_2 = BlockParser(f.read(), language=self.language)
blocks = list(parser_2)
if (len(blocks) != 1) or (blocks[0].input != 'preserve\n'):
fail(f"Modified destination file "
f"{destination.filename!r}, not overwriting!")
f"{destination.filename!r}; not overwriting!")
except FileNotFoundError:
pass

Expand Down
0