Skip to content

Commit

Permalink
fix: remove unreachable code in the websocket decoder (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jun 23, 2024
1 parent aa3bf3f commit 235cdef
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/uiprotect/data/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,19 @@ def decode(self) -> None:
def action_frame(self) -> BaseWSPacketFrame:
if self._action_frame is None:
self.decode()

if self._action_frame is None:
raise WSDecodeError("Packet unexpectedly not decoded")

if TYPE_CHECKING:
assert self._action_frame is not None
assert self._data_frame is not None
self.__dict__["data_frame"] = self._data_frame
return self._action_frame

@cached_property
def data_frame(self) -> BaseWSPacketFrame:
if self._data_frame is None:
self.decode()

if self._data_frame is None:
raise WSDecodeError("Packet unexpectedly not decoded")

if TYPE_CHECKING:
assert self._action_frame is not None
assert self._data_frame is not None
self.__dict__["action_frame"] = self._action_frame
return self._data_frame

Expand Down

0 comments on commit 235cdef

Please sign in to comment.