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

Commit56cc93a

Browse files
sugiderenio
authored andcommitted
Fix fd leak on git cmd.
Currently if command is called with as_proces=True, pipes for thecommand will not be closed.This change makes sure to close command file descriptors.Conflicts:git/cmd.py
1 parent56d5d0c commit56cc93a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎git/cmd.py

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

7575
def__del__(self):
76+
self.proc.stdout.close()
77+
self.proc.stderr.close()
78+
7679
# did the process finish already so we have a return code ?
7780
ifself.proc.poll()isnotNone:
7881
return
@@ -100,6 +103,8 @@ def wait(self):
100103
101104
:raise GitCommandError: if the return status is not 0"""
102105
status=self.proc.wait()
106+
self.proc.stdout.close()
107+
self.proc.stderr.close()
103108
ifstatus!=0:
104109
raiseGitCommandError(self.args,status,self.proc.stderr.read())
105110
# END status handling

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp