summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2018-03-18 21:56:37 +0200
committerHugo <hugovk@users.noreply.github.com>2018-03-18 22:26:31 +0200
commit9ec27096fbe036a97ead869c7522262f63165e1e (patch)
treea3242dc42440ccfd4c30d253d7296dc8410cba5f
parentdb0dfa07e34ed80bfe0ce389da946755ada13c5d (diff)
downloadgitpython-9ec27096fbe036a97ead869c7522262f63165e1e.tar.gz
Unnecessary generator - rewrite as a dict comprehension
-rw-r--r--git/cmd.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 22557490..0f797e23 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -125,7 +125,7 @@ def dashify(string):
def slots_to_dict(self, exclude=()):
- return dict((s, getattr(self, s)) for s in self.__slots__ if s not in exclude)
+ return {s: getattr(self, s) for s in self.__slots__ if s not in exclude}
def dict_to_slots_and__excluded_are_none(self, d, excluded=()):
@@ -972,8 +972,8 @@ class Git(LazyMixin):
:return: Same as ``execute``"""
# Handle optional arguments prior to calling transform_kwargs
# otherwise these'll end up in args, which is bad.
- exec_kwargs = dict((k, v) for k, v in kwargs.items() if k in execute_kwargs)
- opts_kwargs = dict((k, v) for k, v in kwargs.items() if k not in execute_kwargs)
+ exec_kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs}
+ opts_kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs}
insert_after_this_arg = opts_kwargs.pop('insert_kwargs_after', None)