|
2 | 2 | import sys
|
3 | 3 | from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text
|
4 | 4 |
|
| 5 | +if sys.version_info >= (3, 6): |
| 6 | + from os import PathLike |
| 7 | + |
5 | 8 | DEFAULT_IGNORES: List[str]
|
6 | 9 |
|
7 |
| -def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... |
8 |
| -def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], |
9 |
| - shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... |
| 10 | +if sys.version_info >= (3, 6): |
| 11 | + def cmp(f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ...) -> bool: ... |
| 12 | + def cmpfiles(a: Union[AnyStr, PathLike[AnyStr]], b: Union[AnyStr, PathLike[AnyStr]], common: Iterable[AnyStr], |
| 13 | + shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... |
| 14 | +else: |
| 15 | + def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... |
| 16 | + def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], |
| 17 | + shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... |
10 | 18 |
|
11 | 19 | class dircmp(Generic[AnyStr]):
|
12 |
| - def __init__(self, a: AnyStr, b: AnyStr, |
13 |
| - ignore: Optional[Sequence[AnyStr]] = ..., |
14 |
| - hide: Optional[Sequence[AnyStr]] = ...) -> None: ... |
| 20 | + if sys.version_info >= (3, 6): |
| 21 | + def __init__(self, a: Union[AnyStr, PathLike[AnyStr]], b: Union[AnyStr, PathLike[AnyStr]], |
| 22 | + ignore: Optional[Sequence[AnyStr]] = ..., |
| 23 | + hide: Optional[Sequence[AnyStr]] = ...) -> None: ... |
| 24 | + else: |
| 25 | + def __init__(self, a: AnyStr, b: AnyStr, |
| 26 | + ignore: Optional[Sequence[AnyStr]] = ..., |
| 27 | + hide: Optional[Sequence[AnyStr]] = ...) -> None: ... |
15 | 28 |
|
16 | 29 | left: AnyStr
|
17 | 30 | right: AnyStr
|
|
0 commit comments