Skip to content

Commit 83eeb9d

Browse files
authored
Merge pull request #297 from gil-obradors/master
Better interaction with subprocess std[in|out|err]
2 parents c5b08a3 + a9c17d2 commit 83eeb9d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Here you can find the recent changes to libtmux
66

77
current
88
-------
9+
- :issue:`251`: Enchance subprocess interaction std[in|out|err]. Needed
10+
for interact with big buffer
911
- :issue:`303` Add ``common.get_libtmux_version`` which gives the tmux
1012
version as a loose constraint. Fix linking to terms inside docs, and
1113
duplicate description of module which sphinx warned about in api.rst.

libtmux/common.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,7 @@ def __init__(self, *args, **kwargs):
205205
self.process = subprocess.Popen(
206206
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
207207
)
208-
self.process.wait()
209-
stdout = self.process.stdout.read()
210-
self.process.stdout.close()
211-
stderr = self.process.stderr.read()
212-
self.process.stderr.close()
208+
stdout, stderr = self.process.communicate()
213209
returncode = self.process.returncode
214210
except Exception as e:
215211
logger.error('Exception for %s: \n%s' % (subprocess.list2cmdline(cmd), e))

0 commit comments

Comments
 (0)