mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Avoid ResourceWarning messages: close stdout
This commit is contained in:
parent
84dfac6f8e
commit
050a34bceb
@ -97,8 +97,9 @@ except ImportError:
|
|||||||
def readlines(cmd, cwd):
|
def readlines(cmd, cwd):
|
||||||
p = Popen(cmd, shell=False, stdout=PIPE, stderr=PIPE, cwd=cwd)
|
p = Popen(cmd, shell=False, stdout=PIPE, stderr=PIPE, cwd=cwd)
|
||||||
p.stderr.close()
|
p.stderr.close()
|
||||||
for line in p.stdout:
|
with p.stdout:
|
||||||
yield line[:-1].decode('utf-8')
|
for line in p.stdout:
|
||||||
|
yield line[:-1].decode('utf-8')
|
||||||
|
|
||||||
class Repository(object):
|
class Repository(object):
|
||||||
__slots__ = ('directory',)
|
__slots__ = ('directory',)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user