Accept Text in distutils *Version classes (#1854)

This commit is contained in:
Guido van Rossum
2018-02-05 10:50:04 -08:00
committed by Jelle Zijlstra
parent b111a4537f
commit fa98de6d57

View File

@@ -1,6 +1,6 @@
import sys
from abc import abstractmethod
from typing import Any, Optional, TypeVar, Union, Pattern, Tuple
from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple
_T = TypeVar('_T', bound='Version')
@@ -15,9 +15,9 @@ class Version:
def __ge__(self: _T, other: Union[_T, str]) -> bool: ...
@abstractmethod
def __init__(self, vstring: Optional[str] = ...) -> None: ...
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
@abstractmethod
def parse(self: _T, vstring: str) -> _T: ...
def parse(self: _T, vstring: Text) -> _T: ...
@abstractmethod
def __str__(self) -> str: ...
if sys.version_info >= (3,):
@@ -30,10 +30,10 @@ class Version:
class StrictVersion(Version):
version_re: Pattern[str]
version: Tuple[int, int, int]
prerelease: Optional[Tuple[str, int]]
prerelease: Optional[Tuple[Text, int]]
def __init__(self, vstring: Optional[str] = ...) -> None: ...
def parse(self: _T, vstring: str) -> _T: ...
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
def parse(self: _T, vstring: Text) -> _T: ...
def __str__(self) -> str: ...
if sys.version_info >= (3,):
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...
@@ -42,11 +42,11 @@ class StrictVersion(Version):
class LooseVersion(Version):
component_re: Pattern[str]
vstring: str
version: Tuple[Union[str, int], ...]
vstring: Text
version: Tuple[Union[Text, int], ...]
def __init__(self, vstring: Optional[str] = ...) -> None: ...
def parse(self: _T, vstring: str) -> _T: ...
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
def parse(self: _T, vstring: Text) -> _T: ...
def __str__(self) -> str: ...
if sys.version_info >= (3,):
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...