summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2014-07-25 09:53:11 +0200
committerSebastian Thiel <byronimo@gmail.com>2014-07-25 09:53:11 +0200
commit22a2103cf550d141b1e2a82877b9a5de64700210 (patch)
tree1fc87b4b6a2b43a9c80c928b0a13df66d62be103 /git/cmd.py
parentad715a0bceaa0d9e51a9c446a718152df4396de2 (diff)
parentd68ffc3a480d4b67dd11bf3ab4485c0e7ab789e3 (diff)
downloadgitpython-22a2103cf550d141b1e2a82877b9a5de64700210.tar.gz
Merge pull request #176 from craigez/feature/file_closing
Closing file handles/streams
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 1d9b4efb..cbbd0a7a 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -382,6 +382,11 @@ class Git(LazyMixin):
finally:
proc.stdout.close()
proc.stderr.close()
+ if proc.stdin:
+ proc.stdin.close()
+ proc.poll()
+ if proc.returncode is None:
+ proc.terminate()
if self.GIT_PYTHON_TRACE == 'full':
cmdstr = " ".join(command)