summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-09-27 16:05:58 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-09-28 03:35:38 +0200
commite61439b3018b0b9a8eb43e59d0d7cf32041e2fed (patch)
tree864b8c57283d3167b192b69bd17e366252ebee15 /git/cmd.py
parentdf2fb548040c8313f4bb98870788604bc973fa18 (diff)
downloadgitpython-e61439b3018b0b9a8eb43e59d0d7cf32041e2fed.tar.gz
src: constify is_<platform>() calls
+ TCs: unittest-asserts for git-tests.
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 4a2163d5..69844366 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -55,7 +55,7 @@ log.addHandler(logging.NullHandler())
__all__ = ('Git',)
-if is_win():
+if is_win:
WindowsError = OSError
if PY3:
@@ -239,7 +239,7 @@ 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
PROC_CREATIONFLAGS = (CREATE_NO_WINDOW | subprocess.CREATE_NEW_PROCESS_GROUP
- if is_win()
+ if is_win
else 0)
@@ -630,7 +630,7 @@ class Git(LazyMixin):
env["LC_ALL"] = "C"
env.update(self._environment)
- if is_win():
+ if is_win:
cmd_not_found_exception = WindowsError
if kill_after_timeout:
raise GitCommandError('"kill_after_timeout" feature is not supported on Windows.')
@@ -650,13 +650,13 @@ class Git(LazyMixin):
stderr=PIPE,
stdout=PIPE if with_stdout else open(os.devnull, 'wb'),
shell=self.USE_SHELL,
- close_fds=(is_posix()), # unsupported on windows
+ close_fds=(is_posix), # unsupported on windows
universal_newlines=universal_newlines,
creationflags=PROC_CREATIONFLAGS,
**subprocess_kwargs
)
except cmd_not_found_exception as err:
- raise GitCommandNotFound(str(err))
+ raise GitCommandNotFound('%s: %s' % (command[0], err))
if as_process:
return self.AutoInterrupt(proc, command)