Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def getvalue(self) -> str:

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"""
Expand All @@ -341,7 +341,7 @@ def readbytes(self) -> bytes:

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."""
Expand Down