From 27102db959ff9efc9e0377e7294144cfe0efdfcc Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:49:06 +0000 Subject: [PATCH] Annotate ``BaseParser.fail()`` as ``NoReturn`` --- sphinx/util/cfamily.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/util/cfamily.py b/sphinx/util/cfamily.py index 05b5b8922..cf306c994 100644 --- a/sphinx/util/cfamily.py +++ b/sphinx/util/cfamily.py @@ -4,7 +4,7 @@ from __future__ import annotations import re from copy import deepcopy -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, NoReturn from docutils import nodes @@ -341,7 +341,7 @@ class BaseParser: indicator = '-' * self.pos + '^' logger.debug(f'{msg}\n{self.definition}\n{indicator}') # NoQA: G004 - def fail(self, msg: str) -> None: + def fail(self, msg: str) -> NoReturn: errors = [] indicator = '-' * self.pos + '^' msg = (