summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-03-16 19:16:19 +0000
committerYobmod <yobmod@gmail.com>2021-03-16 19:16:19 +0000
commit9562ae2e2436e052d31c40d5f9d3d0318f6c4575 (patch)
tree505a6d9a82a514cf244c2474903567628431081c
parent85ebfb2f0dedb18673a2d756274bbcecd1f034c4 (diff)
downloadgitpython-9562ae2e2436e052d31c40d5f9d3d0318f6c4575.tar.gz
rebase on master
-rw-r--r--doc/source/changes.rst7
-rw-r--r--git/cmd.py9
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst
index 405179d0..93f65a2f 100644
--- a/doc/source/changes.rst
+++ b/doc/source/changes.rst
@@ -2,7 +2,12 @@
Changelog
=========
-3.1.??
+3.1.15 (UNRELEASED)
+===================
+
+* add deprectation warning for python 3.5
+
+3.1.14
======
* git.Commit objects now have a ``replace`` method that will return a
diff --git a/git/cmd.py b/git/cmd.py
index 050efaed..ec630d93 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -19,6 +19,7 @@ import sys
import threading
from collections import OrderedDict
from textwrap import dedent
+import warnings
from git.compat import (
defenc,
@@ -902,8 +903,14 @@ class Git(LazyMixin):
def transform_kwargs(self, split_single_char_options=True, **kwargs):
"""Transforms Python style kwargs into git command line options."""
+ # Python 3.6 preserves the order of kwargs and thus has a stable
+ # order. For older versions sort the kwargs by the key to get a stable
+ # order.
+ if sys.version_info[:2] < (3, 6):
+ kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0]))
+ warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" +
+ "It does not preserve the order for key-word arguments and enforce lexical sorting instead.")
args = []
- kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0]))
for k, v in kwargs.items():
if isinstance(v, (list, tuple)):
for value in v: