From 94ec30874233d9c2ba5cf993cc2af6873638feb3 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Wed, 5 Feb 2020 19:14:30 -0800 Subject: [PATCH] platform: update for py38 (#3717) * platform: update py38 removals Refer to bpo-28167 * platform: libc_ver takes a None executable in py38 --- stdlib/3/platform.pyi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stdlib/3/platform.pyi b/stdlib/3/platform.pyi index debf8d713..c854930cd 100644 --- a/stdlib/3/platform.pyi +++ b/stdlib/3/platform.pyi @@ -1,12 +1,16 @@ # Stubs for platform (Python 3.5) from os import devnull as DEV_NULL -from typing import Tuple, NamedTuple +from typing import Optional, Tuple, NamedTuple import sys -def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... -def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... -def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... +if sys.version_info >= (3, 8): + def libc_ver(executable: Optional[str] = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... +else: + def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... +if sys.version_info < (3, 8): + def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... + def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ... if sys.version_info >= (3, 8): def win32_edition() -> str: ...