From 1f387dd023661790c2ba3ddb9df93a2b0087e874 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 31 Jan 2026 22:02:49 -0800 Subject: [PATCH 1/2] jsonschema: fix type of validator on errors I noticed this while improving mypy's reachability analysis in https://github.com/python/mypy/pull/20660 (because the type of validator is wrong, mypy would think some code is unreachable) --- stubs/jsonschema/jsonschema/exceptions.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index 1560375dabb6..b773030e36b5 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -21,7 +21,7 @@ class _Error(Exception): relative_schema_path: deque[str | int] context: list[ValidationError] cause: Exception | None - validator: Validator | Unset + validator: str | Unset validator_value: Any | Unset instance: Any | Unset schema: Mapping[str, Any] | bool | Unset From a8a01066477a7a775887a0610f549fe6955aeef0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 06:05:05 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/jsonschema/jsonschema/exceptions.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/jsonschema/jsonschema/exceptions.pyi b/stubs/jsonschema/jsonschema/exceptions.pyi index b773030e36b5..aef0c616e705 100644 --- a/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/stubs/jsonschema/jsonschema/exceptions.pyi @@ -6,7 +6,6 @@ from typing_extensions import Self, TypeAlias, deprecated from ._types import TypeChecker from ._utils import Unset -from .protocols import Validator _RelevanceFuncType: TypeAlias = Callable[[ValidationError], SupportsRichComparison]