parse bytes instead of strings
This commit is contained in:
+1
-2
@@ -11,8 +11,7 @@ class MsgReceiver(MsgSink):
|
||||
def is_msg(self, msg: MsgContainer):
|
||||
res = False
|
||||
try:
|
||||
data = msg.data.decode(encoding="utf-8")
|
||||
res = re.match(self.filter, data) is not None
|
||||
res = re.match(bytes(self.filter, encoding="utf-8"), msg.data) is not None
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user