Avoid ResourceWarning messages: close stdout

This commit is contained in:
ZyX 2013-03-17 14:01:10 +04:00
parent 84dfac6f8e
commit 050a34bceb

@ -97,8 +97,9 @@ except ImportError:
def readlines(cmd, cwd):
p = Popen(cmd, shell=False, stdout=PIPE, stderr=PIPE, cwd=cwd)
p.stderr.close()
for line in p.stdout:
yield line[:-1].decode('utf-8')
with p.stdout:
for line in p.stdout:
yield line[:-1].decode('utf-8')
class Repository(object):
__slots__ = ('directory',)