Skip to content

Commit 54dcaf2

Browse files
donBarbosmingyu.park
authored andcommitted
Bump tomllib.TOMLDecodeError to 3.14 (python#14019)
1 parent bf54b07 commit 54dcaf2

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ tarfile.TarFile.zstopen
160160
threading.Thread.__init__
161161
threading._RLock.locked
162162
tkinter.Event.__class_getitem__
163-
tomllib.TOMLDecodeError.__init__
164163
turtle.__all__
165164
turtle.RawTurtle.fill
166165
turtle.RawTurtle.poly

stdlib/tomllib.pyi

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
import sys
12
from _typeshed import SupportsRead
23
from collections.abc import Callable
3-
from typing import Any
4+
from typing import Any, overload
5+
from typing_extensions import deprecated
46

57
__all__ = ("loads", "load", "TOMLDecodeError")
68

7-
class TOMLDecodeError(ValueError): ...
9+
if sys.version_info >= (3, 14):
10+
class TOMLDecodeError(ValueError):
11+
msg: str
12+
doc: str
13+
pos: int
14+
lineno: int
15+
colno: int
16+
@overload
17+
def __init__(self, msg: str, doc: str, pos: int) -> None: ...
18+
@overload
19+
@deprecated("Deprecated in Python 3.14; Please set 'msg', 'doc' and 'pos' arguments only.")
20+
def __init__(self, msg: str | type = ..., doc: str | type = ..., pos: int | type = ..., *args: Any) -> None: ...
21+
22+
else:
23+
class TOMLDecodeError(ValueError): ...
824

925
def load(fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ...
1026
def loads(s: str, /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ...

0 commit comments

Comments
 (0)