Skip to content

Commit 7f5339e

Browse files
committed
Fixed issue where pointer to bytearray was being returned instead of copied bytes
1 parent f5c904c commit 7f5339e

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
@@ -325,7 +325,7 @@ def getvalue(self) -> str:
325325

326326
def getbytes(self) -> bytes:
327327
"""Get the internal contents as bytes"""
328-
return self.buffer.byte_buf
328+
return bytes(self.buffer.byte_buf)
329329

330330
def read(self) -> str:
331331
"""Read from the internal contents as a str and then clear them out"""

0 commit comments

Comments
 (0)