mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Fix stdlib stubtest for latest Python patch releases (#13812)
This commit is contained in:
@@ -2,9 +2,4 @@
|
||||
# >= 3.13
|
||||
# =======
|
||||
|
||||
# Depends on HAVE_NCURSESW and how we install CPython,
|
||||
# should be removed when 3.13 will be officially released:
|
||||
_?curses.unget_wch
|
||||
_?curses.window.get_wch
|
||||
|
||||
(mmap.MAP_32BIT)? # Exists locally on MacOS but not on GitHub
|
||||
|
||||
@@ -290,3 +290,8 @@ sunau.Au_write.initfp
|
||||
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
|
||||
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
|
||||
typing_extensions\.Annotated # Undocumented implementation details
|
||||
|
||||
# Incompatible changes introduced in Python 3.10.17
|
||||
# (Remove once 3.10.17 becomes available for all platforms)
|
||||
(email._header_value_parser.get_encoded_word)?
|
||||
(email._header_value_parser.make_quoted_pairs)?
|
||||
|
||||
@@ -254,3 +254,8 @@ sunau.Au_write.initfp
|
||||
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
|
||||
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
|
||||
typing_extensions\.Annotated # Undocumented implementation details
|
||||
|
||||
# Incompatible changes introduced in Python 3.11.12
|
||||
# (Remove once 3.11.12 becomes available for all platforms)
|
||||
(email._header_value_parser.get_encoded_word)?
|
||||
(email._header_value_parser.make_quoted_pairs)?
|
||||
|
||||
@@ -241,3 +241,7 @@ sunau.Au_write.initfp
|
||||
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
|
||||
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
|
||||
typing_extensions\.Annotated # Undocumented implementation details
|
||||
|
||||
# Incompatible changes introduced in Python 3.9.22
|
||||
# (Remove once 3.9.22 becomes available for all platforms)
|
||||
(email._header_value_parser.get_encoded_word)?
|
||||
|
||||
+8
-7
@@ -95,13 +95,14 @@ BUTTON4_DOUBLE_CLICKED: int
|
||||
BUTTON4_PRESSED: int
|
||||
BUTTON4_RELEASED: int
|
||||
BUTTON4_TRIPLE_CLICKED: int
|
||||
# Darwin ncurses doesn't provide BUTTON5_* constants
|
||||
if sys.version_info >= (3, 10) and sys.platform != "darwin":
|
||||
BUTTON5_PRESSED: int
|
||||
BUTTON5_RELEASED: int
|
||||
BUTTON5_CLICKED: int
|
||||
BUTTON5_DOUBLE_CLICKED: int
|
||||
BUTTON5_TRIPLE_CLICKED: int
|
||||
# Darwin ncurses doesn't provide BUTTON5_* constants prior to 3.12.10 and 3.13.3
|
||||
if sys.version_info >= (3, 10):
|
||||
if sys.version_info >= (3, 12) or sys.platform != "darwin":
|
||||
BUTTON5_PRESSED: int
|
||||
BUTTON5_RELEASED: int
|
||||
BUTTON5_CLICKED: int
|
||||
BUTTON5_DOUBLE_CLICKED: int
|
||||
BUTTON5_TRIPLE_CLICKED: int
|
||||
BUTTON_ALT: int
|
||||
BUTTON_CTRL: int
|
||||
BUTTON_SHIFT: int
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ if sys.platform == "win32":
|
||||
SO_EXCLUSIVEADDRUSE: int
|
||||
if sys.platform != "win32":
|
||||
SO_REUSEPORT: int
|
||||
if sys.platform != "darwin":
|
||||
if sys.platform != "darwin" or sys.version_info >= (3, 13):
|
||||
SO_BINDTODEVICE: int
|
||||
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
|
||||
@@ -22,7 +22,8 @@ NLSET: Final[set[str]]
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
SPECIALSNL: Final[set[str]]
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
if sys.version_info >= (3, 10):
|
||||
# Added in Python 3.10.17, 3.11.12, 3.12.9, 3.13.2 (may still be backported to 3.9)
|
||||
def make_quoted_pairs(value: Any) -> str: ...
|
||||
|
||||
def quote_string(value: Any) -> str: ...
|
||||
@@ -349,7 +350,7 @@ ListSeparator: Final[ValueTerminal]
|
||||
RouteComponentMarker: Final[ValueTerminal]
|
||||
|
||||
def get_fws(value: str) -> tuple[WhiteSpaceTerminal, str]: ...
|
||||
def get_encoded_word(value: str) -> tuple[EncodedWord, str]: ...
|
||||
def get_encoded_word(value: str, terminal_type: str = "vtext") -> tuple[EncodedWord, str]: ...
|
||||
def get_unstructured(value: str) -> UnstructuredTokenList: ...
|
||||
def get_qp_ctext(value: str) -> tuple[WhiteSpaceTerminal, str]: ...
|
||||
def get_qcontent(value: str) -> tuple[ValueTerminal, str]: ...
|
||||
|
||||
@@ -37,11 +37,12 @@ if sys.version_info < (3, 11):
|
||||
elif sys.version_info < (3, 13):
|
||||
Resource: TypeAlias = str
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
if sys.version_info >= (3, 12):
|
||||
from importlib.resources._common import Anchor as Anchor
|
||||
|
||||
__all__ += ["Anchor"]
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
from importlib.resources._functional import (
|
||||
contents as contents,
|
||||
is_resource as is_resource,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptorOrPath
|
||||
from collections.abc import Sized
|
||||
|
||||
@@ -8,6 +9,8 @@ class ResourceTracker:
|
||||
def ensure_running(self) -> None: ...
|
||||
def register(self, name: Sized, rtype: str) -> None: ...
|
||||
def unregister(self, name: Sized, rtype: str) -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
_resource_tracker: ResourceTracker
|
||||
ensure_running = _resource_tracker.ensure_running
|
||||
|
||||
+1
-1
@@ -514,7 +514,7 @@ if sys.platform != "win32":
|
||||
"IPV6_RTHDRDSTOPTS",
|
||||
]
|
||||
|
||||
if sys.platform != "darwin":
|
||||
if sys.platform != "darwin" or sys.version_info >= (3, 13):
|
||||
from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE
|
||||
|
||||
__all__ += ["SO_BINDTODEVICE"]
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ class Untokenizer:
|
||||
prev_col: int
|
||||
encoding: str | None
|
||||
def add_whitespace(self, start: _Position) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
if sys.version_info >= (3, 12):
|
||||
def add_backslash_continuation(self, start: _Position) -> None: ...
|
||||
|
||||
def untokenize(self, iterable: Iterable[_Token]) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user