Skip to content

Commit 4daf3d7

Browse files
committed
Fix undefined fields in Python 3.14
1 parent dd6dc1d commit 4daf3d7

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

stdlib/asyncio/events.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ from .futures import Future
2121
from .protocols import BaseProtocol
2222
from .tasks import Task
2323
from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport
24-
from .unix_events import AbstractChildWatcher
24+
25+
if sys.version_info < (3, 14):
26+
from .unix_events import AbstractChildWatcher
2527

2628
# Keep asyncio.__all__ updated with any changes to __all__ here
2729
if sys.version_info >= (3, 14):

stdlib/sqlite3/__init__.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ from sqlite3.dbapi2 import (
6060
sqlite_version as sqlite_version,
6161
sqlite_version_info as sqlite_version_info,
6262
threadsafety as threadsafety,
63-
version_info as version_info,
6463
)
6564
from types import TracebackType
6665
from typing import Any, Literal, Protocol, SupportsIndex, TypeVar, final, overload, type_check_only
6766
from typing_extensions import Self, TypeAlias
6867

68+
if sys.version_info < (3, 14):
69+
from sqlite3.dbapi2 import version_info as version_info
70+
6971
if sys.version_info >= (3, 12):
7072
from sqlite3.dbapi2 import (
7173
LEGACY_TRANSACTION_CONTROL as LEGACY_TRANSACTION_CONTROL,

stdlib/typing.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ __all__ = [
3737
"AsyncIterator",
3838
"Awaitable",
3939
"BinaryIO",
40-
"ByteString",
4140
"Callable",
4241
"ChainMap",
4342
"ClassVar",
@@ -106,6 +105,9 @@ __all__ = [
106105
"runtime_checkable",
107106
]
108107

108+
if sys.version_info < (3, 14):
109+
__all__ += ["ByteString"]
110+
109111
if sys.version_info >= (3, 10):
110112
__all__ += ["Concatenate", "ParamSpec", "ParamSpecArgs", "ParamSpecKwargs", "TypeAlias", "TypeGuard", "is_typeddict"]
111113

stubs/pyflakes/pyflakes/checker.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ class AnnotationState:
149149
def in_annotation(func: _F) -> _F: ...
150150
def in_string_annotation(func: _F) -> _F: ...
151151

152+
if sys.version_info < (3, 14):
153+
_NameConstant: TypeAlias = ast.NameConstant
154+
else:
155+
_NameConstant: TypeAlias = Never
156+
152157
if sys.version_info >= (3, 10):
153158
_Match: TypeAlias = ast.Match
154159
_MatchCase: TypeAlias = ast.match_case
@@ -254,7 +259,7 @@ class Checker:
254259
def SET(self, tree: ast.Set, omit: _OmitType = None) -> None: ...
255260
def ATTRIBUTE(self, tree: ast.Attribute, omit: _OmitType = None) -> None: ...
256261
def STARRED(self, tree: ast.Starred, omit: _OmitType = None) -> None: ...
257-
def NAMECONSTANT(self, tree: ast.NameConstant, omit: _OmitType = None) -> None: ...
262+
def NAMECONSTANT(self, tree: _NameConstant, omit: _OmitType = None) -> None: ...
258263
def NAMEDEXPR(self, tree: ast.NamedExpr, omit: _OmitType = None) -> None: ...
259264
def SUBSCRIPT(self, node: ast.Subscript) -> None: ...
260265
def CALL(self, node: ast.Call) -> None: ...

0 commit comments

Comments
 (0)