Added check to parser encoder to automatically encode json if the message data is not a string
This commit is contained in:
parent
66e563acc3
commit
6f8e76adfd
1 changed files with 2 additions and 0 deletions
|
|
@ -98,6 +98,8 @@ class Message():
|
|||
|
||||
def encode_as_string(self):
|
||||
"""Same as the encode_as_string method except it doesn't encode things as a JSON string"""
|
||||
if not isinstance(self.message, basestring):
|
||||
return self.encode_as_json();
|
||||
data = self.message;
|
||||
if self.id is not None:
|
||||
data = str(self.id) + self.message;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue