|
17 | 17 | import subprocess |
18 | 18 | import sys |
19 | 19 | import threading |
20 | | -from collections import OrderedDict |
21 | 20 | from textwrap import dedent |
22 | | -import warnings |
23 | 21 |
|
24 | 22 | from git.compat import ( |
25 | 23 | defenc, |
@@ -150,7 +148,6 @@ def dashify(string: str) -> str: |
150 | 148 |
|
151 | 149 |
|
152 | 150 | def slots_to_dict(self, exclude: Sequence[str] = ()) -> Dict[str, Any]: |
153 | | - # annotate self.__slots__ as Tuple[str, ...] once 3.5 dropped |
154 | 151 | return {s: getattr(self, s) for s in self.__slots__ if s not in exclude} |
155 | 152 |
|
156 | 153 |
|
@@ -462,7 +459,7 @@ class CatFileContentStream(object): |
462 | 459 | If not all data is read to the end of the objects's lifetime, we read the |
463 | 460 | rest to assure the underlying stream continues to work""" |
464 | 461 |
|
465 | | - __slots__ = ('_stream', '_nbr', '_size') |
| 462 | + __slots__: Tuple[str, ...] = ('_stream', '_nbr', '_size') |
466 | 463 |
|
467 | 464 | def __init__(self, size: int, stream: IO[bytes]) -> None: |
468 | 465 | self._stream = stream |
@@ -1005,13 +1002,6 @@ def transform_kwarg(self, name: str, value: Any, split_single_char_options: bool |
1005 | 1002 |
|
1006 | 1003 | def transform_kwargs(self, split_single_char_options: bool = True, **kwargs: Any) -> List[str]: |
1007 | 1004 | """Transforms Python style kwargs into git command line options.""" |
1008 | | - # Python 3.6 preserves the order of kwargs and thus has a stable |
1009 | | - # order. For older versions sort the kwargs by the key to get a stable |
1010 | | - # order. |
1011 | | - if sys.version_info[:2] < (3, 6): |
1012 | | - kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) |
1013 | | - warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" + |
1014 | | - "It does not preserve the order for key-word arguments and enforce lexical sorting instead.") |
1015 | 1005 | args = [] |
1016 | 1006 | for k, v in kwargs.items(): |
1017 | 1007 | if isinstance(v, (list, tuple)): |
|
0 commit comments