Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c5b87b

Browse files
committed
Merge pull requestgitpython-developers#150 from derenio/0.3
Merged fd leaks fix from the master to the 0.3 version
2 parents9ea3dbd +b137f55 commit9c5b87b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎git/cmd.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ def __init__(self, proc, args ):
7474
self.args=args
7575

7676
def__del__(self):
77+
self.proc.stdout.close()
78+
self.proc.stderr.close()
79+
7780
# did the process finish already so we have a return code ?
7881
ifself.proc.poll()isnotNone:
7982
return
@@ -85,6 +88,8 @@ def __del__(self):
8588
# try to kill it
8689
try:
8790
os.kill(self.proc.pid,2)# interrupt signal
91+
exceptOSError:
92+
pass# ignore error when process already died
8893
exceptAttributeError:
8994
# try windows
9095
# for some reason, providing None for stdout/stderr still prints something. This is why
@@ -101,6 +106,8 @@ def wait(self):
101106
102107
:raise GitCommandError: if the return status is not 0"""
103108
status=self.proc.wait()
109+
self.proc.stdout.close()
110+
self.proc.stderr.close()
104111
ifstatus!=0:
105112
raiseGitCommandError(self.args,status,self.proc.stderr.read())
106113
# END status handling

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp