Skip to content

Commit

Permalink
Merge branch 'main' into charmcraft_yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt committed Jul 24, 2023
2 parents 304bbb1 + 2c82af3 commit 1757a80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ops/pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def connect(self, url: str, socket: socket.socket): ... # noqa
def shutdown(self): ... # noqa
def send(self, payload: str): ... # noqa
def send_binary(self, payload: bytes): ... # noqa
def recv(self) -> typing.AnyStr: ... # noqa
def recv(self) -> Union[str, bytes]: ... # noqa

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -1411,7 +1411,7 @@ def _websocket_to_writer(ws: '_WebSocket', writer: '_WebsocketWriter',
encoding: Optional[str]):
"""Receive messages from websocket (until end signal) and write to writer."""
while True:
chunk: Union[str, bytes] = typing.cast(Union[str, bytes], ws.recv())
chunk = ws.recv()

if isinstance(chunk, str):
try:
Expand Down Expand Up @@ -1474,7 +1474,7 @@ def read(self, n: int = -1) -> Union[str, bytes]:
return b''

while not self.remaining:
chunk: Union[str, bytes] = typing.cast(Union[str, bytes], self.ws.recv())
chunk = self.ws.recv()

if isinstance(chunk, str):
try:
Expand Down

0 comments on commit 1757a80

Please sign in to comment.