From 2a3ff630e88f2b1d4f35966adc70b21f63431d3c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Dec 2021 23:26:02 +0100 Subject: [PATCH] Fix return type of ParserBase.error (#6666) As this is an abstract method, NoReturn is problematic as deriving classes (for example in beautifulsoup4 or fpdf2) have an incompatible return type. --- stdlib/_markupbase.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/_markupbase.pyi b/stdlib/_markupbase.pyi index b942f75ea..2c497f65b 100644 --- a/stdlib/_markupbase.pyi +++ b/stdlib/_markupbase.pyi @@ -1,5 +1,5 @@ import sys -from typing import NoReturn +from typing import Any class ParserBase: def __init__(self) -> None: ... @@ -12,6 +12,6 @@ class ParserBase: def updatepos(self, i: int, j: int) -> int: ... # undocumented if sys.version_info < (3, 10): # Removed from ParserBase: https://bugs.python.org/issue31844 - def error(self, message: str) -> NoReturn: ... # undocumented + def error(self, message: str) -> Any: ... # undocumented lineno: int # undocumented offset: int # undocumented