mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
gh-113317: Argument Clinic: don't use fail() in CLI (#115513)
This commit is contained in:
parent
edb59d5718
commit
98ee4ecdbc
1 changed files with 2 additions and 2 deletions
|
|
@ -2500,12 +2500,12 @@ def parse_file(
|
|||
|
||||
extension = os.path.splitext(filename)[1][1:]
|
||||
if not extension:
|
||||
fail(f"Can't extract file type for file {filename!r}")
|
||||
raise ClinicError(f"Can't extract file type for file {filename!r}")
|
||||
|
||||
try:
|
||||
language = extensions[extension](filename)
|
||||
except KeyError:
|
||||
fail(f"Can't identify file type for file {filename!r}")
|
||||
raise ClinicError(f"Can't identify file type for file {filename!r}")
|
||||
|
||||
with open(filename, encoding="utf-8") as f:
|
||||
raw = f.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue