Skip to content

Commit

Permalink
Merge branch 'master' into fix_pytest_deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
prologic committed Dec 7, 2018
2 parents a069c0d + cd1563b commit 016a301
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions circuits/protocols/irc/message.py
Expand Up @@ -13,18 +13,18 @@ class Error(Exception):
class Message(object):

def __init__(self, command, *args, **kwargs):
if any(u(' ') in arg for arg in args[:-1]):
raise Error("Space can only appear in the very last arg")
if any(u('\n') in arg for arg in args):
raise Error("No newline allowed")

self.command = command
self.args = [x for x in args if x is not None]
self.prefix = text_type(kwargs["prefix"]) if "prefix" in kwargs else None

self.encoding = kwargs.get("encoding", "utf-8")
self.add_nick = kwargs.get("add_nick", False)

if any(u(' ') in arg for arg in self.args[:-1]):
raise Error("Space can only appear in the very last arg")
if any(u('\n') in arg for arg in self.args):
raise Error("No newline allowed")

@staticmethod
def from_string(s):
if len(s) > 512:
Expand Down

0 comments on commit 016a301

Please sign in to comment.