Skip to content

Commit 1f08873

Browse files
committed
Clearing bytearray instead of creating a new object
1 parent 7f5339e commit 1f08873

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def readbytes(self) -> bytes:
341341

342342
def clear(self) -> None:
343343
"""Clear the internal contents"""
344-
self.buffer.byte_buf = bytearray()
344+
self.buffer.byte_buf.clear()
345345

346346
def isatty(self) -> bool:
347347
"""StdSim only considered an interactive stream if `echo` is True and `inner_stream` is a tty."""

0 commit comments

Comments
 (0)