Skip to content

Commit bdd06fb

Browse files
authored
Merge pull request #204 from python-cmd2/pipe_simplify
The default buffer size is fine for 99% of pipe operations
2 parents b319900 + 3db44e5 commit bdd06fb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cmd2.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,6 @@ def __init__(self, completekey='tab', stdin=None, stdout=None, use_ipython=False
545545
# Used when piping command output to a shell command
546546
self.pipe_proc = None
547547

548-
# Size of the stdin/stdout buffers used when piping command output to a shell command via self.stdout.
549-
# This should be increased in cases where large amounts of data are expected to be piped to the shell
550-
# to prevent blocking when writing to self.stdout.
551-
self._pipe_buffer_size = io.DEFAULT_BUFFER_SIZE
552-
553548
# ----- Methods related to presenting output to the user -----
554549

555550
@property
@@ -816,9 +811,9 @@ def _redirect_output(self, statement):
816811

817812
# Open each side of the pipe and set stdout accordingly
818813
# noinspection PyTypeChecker
819-
self.stdout = io.open(write_fd, write_mode, buffering=self._pipe_buffer_size)
814+
self.stdout = io.open(write_fd, write_mode)
820815
# noinspection PyTypeChecker
821-
subproc_stdin = io.open(read_fd, read_mode, buffering=self._pipe_buffer_size)
816+
subproc_stdin = io.open(read_fd, read_mode)
822817

823818
# We want Popen to raise an exception if it fails to open the process. Thus we don't set shell to True.
824819
try:

0 commit comments

Comments
 (0)