From a96939b4e88302e13abc033355cbf21cb66bd3ac Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 27 Mar 2019 21:42:43 -0400 Subject: Renamed stuff and removed unneeded KeyboardInterrupt protection --- cmd2/utils.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'cmd2/utils.py') diff --git a/cmd2/utils.py b/cmd2/utils.py index 5bb08edd..4172e362 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -414,19 +414,14 @@ class ProcReader(object): def wait(self) -> None: """Wait for the process to finish""" - while True: - try: - if self._out_thread.is_alive(): - self._out_thread.join() - if self._err_thread.is_alive(): - self._err_thread.join() - - # Handle case where the process ended before the last read could be done. - # This will return None for the streams that weren't pipes. - out, err = self._proc.communicate() - break - except KeyboardInterrupt: - pass + if self._out_thread.is_alive(): + self._out_thread.join() + if self._err_thread.is_alive(): + self._err_thread.join() + + # Handle case where the process ended before the last read could be done. + # This will return None for the streams that weren't pipes. + out, err = self._proc.communicate() if out: self._write_bytes(self._stdout, out) -- cgit v1.2.1