Skip to content

Commit b84879d

Browse files
committed
Handle bytearray
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 7f5f9a5 commit b84879d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ptscripts/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ def __init__(self, *args, capture: bool = False, **kwargs) -> None:
134134
self._capture: bool = capture
135135
self._last_write: datetime | None = None
136136

137-
def pipe_data_received(self, fd: int, data: bytes | str) -> None: # noqa: D102
137+
def pipe_data_received(self, fd: int, data: bytes | bytearray | str) -> None: # noqa: D102
138138
self._last_write = datetime.now(tz=timezone.utc)
139139
if self._capture:
140140
super().pipe_data_received(fd, data)
141141
return
142-
if isinstance(data, bytes):
142+
if isinstance(data, (bytes, bytearray)):
143143
decoded_data = data.decode("utf-8")
144144
else:
145145
decoded_data = data

0 commit comments

Comments
 (0)