summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 72ba82c3..78b5ff70 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -139,9 +139,9 @@ def dict_to_slots_and__excluded_are_none(self, d, excluded=()):
CREATE_NO_WINDOW = 0x08000000
## CREATE_NEW_PROCESS_GROUP is needed to allow killing it afterwards,
-# seehttps://docs.python.org/3/library/subprocess.html#subprocess.Popen.send_signal
+# see https://docs.python.org/3/library/subprocess.html#subprocess.Popen.send_signal
PROC_CREATIONFLAGS = (CREATE_NO_WINDOW | subprocess.CREATE_NEW_PROCESS_GROUP
- if is_win
+ if is_win and sys.version_info >= (2, 7)
else 0)
@@ -245,7 +245,7 @@ class Git(LazyMixin):
return
# can be that nothing really exists anymore ...
- if os is None or os.kill is None:
+ if os is None or getattr(os, 'kill', None) is None:
return
# try to kill it
@@ -831,8 +831,12 @@ 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.
- _kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs}
- kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs}
+ _kwargs = dict()
+ for kwarg in execute_kwargs:
+ try:
+ _kwargs[kwarg] = kwargs.pop(kwarg)
+ except KeyError:
+ pass
insert_after_this_arg = kwargs.pop('insert_kwargs_after', None)