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/util.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/util.py')
-rw-r--r-- | git/util.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/git/util.py b/git/util.py index efecca83..1dbbd35d 100644 --- a/git/util.py +++ b/git/util.py @@ -9,11 +9,15 @@ import getpass import logging import os import platform +import subprocess import re import shutil import stat import time -from unittest.case import SkipTest +try: + from unittest import SkipTest +except ImportError: + from unittest2 import SkipTest from gitdb.util import (# NOQA @IgnorePep8 make_sha, @@ -301,7 +305,7 @@ def is_cygwin_git(git_executable): if not is_win: return False - from subprocess import check_output + #from subprocess import check_output is_cygwin = _is_cygwin_cache.get(git_executable) if is_cygwin is None: @@ -314,8 +318,11 @@ def is_cygwin_git(git_executable): ## Just a name given, not a real path. uname_cmd = osp.join(git_dir, 'uname') - uname = check_output(uname_cmd, universal_newlines=True) - is_cygwin = 'CYGWIN' in uname + process = subprocess.Popen([uname_cmd], stdout=subprocess.PIPE, + universal_newlines=True) + uname_out, _ = process.communicate() + #retcode = process.poll() + is_cygwin = 'CYGWIN' in uname_out except Exception as ex: log.debug('Failed checking if running in CYGWIN due to: %r', ex) _is_cygwin_cache[git_executable] = is_cygwin |