From ddb57608fdfbbea3e7caf4d7a04934964ab6e5c8 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Tue, 1 Oct 2024 18:45:11 -0700 Subject: [PATCH] move pyexpat.ExpatError to xml.parsers.expat.ExpatError (#11168) This matches the name reported by the cass at runtime. related to https://github.com/python/typeshed/issues/11141 Co-authored-by: Jelle Zijlstra --- stdlib/pyexpat/__init__.pyi | 6 +----- stdlib/xml/parsers/expat/__init__.pyi | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stdlib/pyexpat/__init__.pyi b/stdlib/pyexpat/__init__.pyi index dc0156ef1..d38259a20 100644 --- a/stdlib/pyexpat/__init__.pyi +++ b/stdlib/pyexpat/__init__.pyi @@ -3,17 +3,13 @@ from collections.abc import Callable from pyexpat import errors as errors, model as model from typing import Any, Final, final from typing_extensions import TypeAlias +from xml.parsers.expat import ExpatError as ExpatError EXPAT_VERSION: Final[str] # undocumented version_info: tuple[int, int, int] # undocumented native_encoding: str # undocumented features: list[tuple[str, int]] # undocumented -class ExpatError(Exception): - code: int - lineno: int - offset: int - error = ExpatError XML_PARAM_ENTITY_PARSING_NEVER: Final = 0 XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: Final = 1 diff --git a/stdlib/xml/parsers/expat/__init__.pyi b/stdlib/xml/parsers/expat/__init__.pyi index 73f3758c6..d9b7ea536 100644 --- a/stdlib/xml/parsers/expat/__init__.pyi +++ b/stdlib/xml/parsers/expat/__init__.pyi @@ -1 +1,7 @@ from pyexpat import * + +# This is actually implemented in the C module pyexpat, but considers itself to live here. +class ExpatError(Exception): + code: int + lineno: int + offset: int