From 5e0f6010217de8c5373bad526007f13220834834 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Fri, 22 Nov 2024 02:40:41 +0200 Subject: [PATCH 1/2] Update `TOMLDecodeError` for Python 3.14 --- stdlib/tomllib.pyi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/stdlib/tomllib.pyi b/stdlib/tomllib.pyi index d559568b912b..925cd584c910 100644 --- a/stdlib/tomllib.pyi +++ b/stdlib/tomllib.pyi @@ -1,10 +1,20 @@ from _typeshed import SupportsRead from collections.abc import Callable +import sys from typing import Any __all__ = ("loads", "load", "TOMLDecodeError") -class TOMLDecodeError(ValueError): ... +if sys.version_info >= (3, 14): + class TOMLDecodeError(ValueError): + msg: str + doc: str + pos: int + lineno: int + colno: int + def __init__(self, msg: str, doc: str, pos: int) -> None: ... +else: + class TOMLDecodeError(ValueError): ... def load(fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... def loads(s: str, /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... From 06662ff8bff4827207c9dd57da592d939655b995 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:46:55 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/tomllib.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/tomllib.pyi b/stdlib/tomllib.pyi index 925cd584c910..e8e7ac74a0a0 100644 --- a/stdlib/tomllib.pyi +++ b/stdlib/tomllib.pyi @@ -1,6 +1,6 @@ +import sys from _typeshed import SupportsRead from collections.abc import Callable -import sys from typing import Any __all__ = ("loads", "load", "TOMLDecodeError") @@ -13,6 +13,7 @@ if sys.version_info >= (3, 14): lineno: int colno: int def __init__(self, msg: str, doc: str, pos: int) -> None: ... + else: class TOMLDecodeError(ValueError): ...