Skip to content

Commit

Permalink
Revert "Fix for сlosing message formatting (#289)"
Browse files Browse the repository at this point in the history
This reverts commit cb60792.
  • Loading branch information
auvipy authored Nov 3, 2024
1 parent cb60792 commit 6fa82b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/mocking_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def recv(self, size):
current_bytes = self.remaining_bytes[:size]
self.remaining_bytes = self.remaining_bytes[size:]

if self.remaining_bytes == b'':
if self.remaining_bytes is b'':
self.frame = None
self.remaining_bytes = None

Expand Down
4 changes: 2 additions & 2 deletions ws4py/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def process(self, bytes):
self.reading_buffer_size = s.parser.send(bytes) or DEFAULT_READING_SIZE

if s.closing is not None:
logger.debug("Closing message received (%d): %s" % (s.closing.code, s.closing.reason.decode() if isinstance(s.closing.reason, bytes) else s.closing.reason))
logger.debug("Closing message received (%d) '%s'" % (s.closing.code, s.closing.reason))
if not self.server_terminated:
self.close(s.closing.code, s.closing.reason)
else:
Expand All @@ -471,7 +471,7 @@ def process(self, bytes):

if s.errors:
for error in s.errors:
logger.debug("Error message received (%d): %s" % (error.code, error.reason.decode() if isinstance(error.reason, bytes) else error.reason))
logger.debug("Error message received (%d) '%s'" % (error.code, error.reason))
self.close(error.code, error.reason)
s.errors = []
return False
Expand Down

0 comments on commit 6fa82b3

Please sign in to comment.