]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-113317: Argument Clinic: don't use fail() in CLI (#115513)
authorErlend E. Aasland <erlend@python.org>
Thu, 15 Feb 2024 12:10:32 +0000 (13:10 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Feb 2024 12:10:32 +0000 (12:10 +0000)
Tools/clinic/clinic.py

index e63596c30079403df173835ca685356da32ec38c..2381004f02352aba6da30cc3c9a6ac373c113cb5 100755 (executable)
@@ -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()