Skip to content

Commit

Permalink
Merge pull request #122 from malefice/master
Browse files Browse the repository at this point in the history
Added RedisMessage support for bytestrings
  • Loading branch information
jrief committed Dec 2, 2015
2 parents 2977c64 + 5d3f0a8 commit 1fabfdc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ws4redis/redis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def __new__(cls, value):
if value != settings.WS4REDIS_HEARTBEAT:
value = value.encode()
return super(RedisMessage, cls).__new__(cls, value)
elif isinstance(value, bytes):
if value != settings.WS4REDIS_HEARTBEAT.encode():
return super(RedisMessage, cls).__new__(cls, value)
elif isinstance(value, list):
if len(value) >= 2 and value[0] == b'message':
return super(RedisMessage, cls).__new__(cls, value[2])
Expand Down

0 comments on commit 1fabfdc

Please sign in to comment.