Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork944
Restore order of operators before executing the git command only for < py3.6#1193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -19,6 +19,7 @@ | ||
import threading | ||
from collections import OrderedDict | ||
from textwrap import dedent | ||
import warnings | ||
from git.compat import ( | ||
defenc, | ||
@@ -902,8 +903,14 @@ def transform_kwarg(self, name, value, split_single_char_options): | ||
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): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. In order to make people aware, could you add a deprecation warning mentioning the date until this will work? | ||
kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) | ||
warnings.warn("Python 3.5 support is deprecated. It does not preserve the order\n" + | ||
"for key-word arguments. Thus they will be sorted!!") | ||
args = [] | ||
for k, v in kwargs.items(): | ||
if isinstance(v, (list, tuple)): | ||
for value in v: | ||