|
19 | 19 | importthreading
|
20 | 20 | fromcollectionsimportOrderedDict
|
21 | 21 | fromtextwrapimportdedent
|
| 22 | +importwarnings |
22 | 23 |
|
23 | 24 | fromgit.compatimport (
|
24 | 25 | defenc,
|
@@ -902,8 +903,14 @@ def transform_kwarg(self, name, value, split_single_char_options):
|
902 | 903 |
|
903 | 904 | deftransform_kwargs(self,split_single_char_options=True,**kwargs):
|
904 | 905 | """Transforms Python style kwargs into git command line options."""
|
| 906 | +# Python 3.6 preserves the order of kwargs and thus has a stable |
| 907 | +# order. For older versions sort the kwargs by the key to get a stable |
| 908 | +# order. |
| 909 | +ifsys.version_info[:2]< (3,6): |
| 910 | +kwargs=OrderedDict(sorted(kwargs.items(),key=lambdax:x[0])) |
| 911 | +warnings.warn("Python 3.5 support is deprecated. It does not preserve the order\n"+ |
| 912 | +"for key-word arguments. Thus they will be sorted!!") |
905 | 913 | args= []
|
906 |
| -kwargs=OrderedDict(sorted(kwargs.items(),key=lambdax:x[0])) |
907 | 914 | fork,vinkwargs.items():
|
908 | 915 | ifisinstance(v, (list,tuple)):
|
909 | 916 | forvalueinv:
|
|