|
17 | 17 | importsubprocess |
18 | 18 | importsys |
19 | 19 | importthreading |
20 | | -fromcollectionsimportOrderedDict |
21 | 20 | fromtextwrapimportdedent |
22 | | -importwarnings |
23 | 21 |
|
24 | 22 | fromgit.compatimport ( |
25 | 23 | defenc, |
@@ -150,7 +148,6 @@ def dashify(string: str) -> str: |
150 | 148 |
|
151 | 149 |
|
152 | 150 | defslots_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)forsinself.__slots__ifsnotinexclude} |
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 | deftransform_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 | | -ifsys.version_info[:2]< (3,6): |
1012 | | -kwargs=OrderedDict(sorted(kwargs.items(),key=lambdax: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 | fork,vinkwargs.items(): |
1017 | 1007 | ifisinstance(v, (list,tuple)): |
|