diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-12-08 13:20:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-08 13:20:52 +0100 |
commit | 2f207e0e15ad243dd24eafce8b60ed2c77d6e725 (patch) | |
tree | 9460e9e1178c21389386e49e336550093d34448b /git/cmd.py | |
parent | a8437c014b0a9872168b01790f5423e8e9255840 (diff) | |
parent | f3d5df2ce3addd9e9e1863f4f33665a16b415b71 (diff) | |
download | gitpython-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.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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) |