File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,12 +48,10 @@ def stop(self):
4848 """
4949 Stop capturing the stream data and save the text in `capturedtext`.
5050 """
51-
5251 # Print the escape character to make the readOutput method stop:
53- self . origstream . write (self .escape_char )
52+ os . write (self .pipe_in , self . escape_char . encode () )
5453 # Flush the stream to make sure all our data goes in before
5554 # the escape character:
56- self .origstream .flush ()
5755 if self .threaded :
5856 # wait until the thread finishes so we are sure that
5957 # we have until the last character:
@@ -74,7 +72,7 @@ def readOutput(self):
7472 and save the text in `capturedtext`.
7573 """
7674 while True :
77- char = os .read (self .pipe_out , 1 ).decode (self . origstream . encoding )
75+ char = os .read (self .pipe_out , 1 ).decode ()
7876 if not char or self .escape_char in char :
7977 break
8078 self .capturedtext += char
You can’t perform that action at this time.
0 commit comments