diff options
-rw-r--r-- | cmd2/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index d8ac513d..35c953e0 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -325,7 +325,7 @@ class StdSim(object): def getbytes(self) -> bytes: """Get the internal contents as bytes""" - return self.buffer.byte_buf + return bytes(self.buffer.byte_buf) def read(self) -> str: """Read from the internal contents as a str and then clear them out""" @@ -341,7 +341,7 @@ class StdSim(object): def clear(self) -> None: """Clear the internal contents""" - self.buffer.byte_buf = bytearray() + self.buffer.byte_buf.clear() def isatty(self) -> bool: """StdSim only considered an interactive stream if `echo` is True and `inner_stream` is a tty.""" |