summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 9b2abc71..3fa24fff 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -279,8 +279,10 @@ class Git(LazyMixin):
self.proc = None
if proc.stdin:
proc.stdin.close()
- proc.stdout.close()
- proc.stderr.close()
+ if proc.stdout:
+ proc.stdout.close()
+ if proc.stderr:
+ proc.stderr.close()
# did the process finish already so we have a return code ?
if proc.poll() is not None: