summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2016-12-08 13:20:52 +0100
committerGitHub <noreply@github.com>2016-12-08 13:20:52 +0100
commit2f207e0e15ad243dd24eafce8b60ed2c77d6e725 (patch)
tree9460e9e1178c21389386e49e336550093d34448b /git/cmd.py
parenta8437c014b0a9872168b01790f5423e8e9255840 (diff)
parentf3d5df2ce3addd9e9e1863f4f33665a16b415b71 (diff)
downloadgitpython-2f207e0e15ad243dd24eafce8b60ed2c77d6e725.tar.gz
Merge pull request #541 from andy-maier/py26_fixes
Fixes to support Python 2.6 again.
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 71c9e5a0..245a7f60 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -140,9 +140,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)
@@ -246,7 +246,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
@@ -832,8 +832,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)