Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletiongit/cmd.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
import threading
from collections import OrderedDict
from textwrap import dedent
import warnings

from git.compat import (
defenc,
Expand DownExpand Up@@ -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):
Copy link
Member

Choose a reason for hiding this comment

The 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 = []
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:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp