mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
gh-113317: Argument Clinic: don't use fail() in CLI (#115513)
This commit is contained in:
parent
edb59d5718
commit
98ee4ecdbc
@ -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…
Reference in New Issue
Block a user