-
-
Save prologic/f251ad69095c0ce855b4 to your computer and use it in GitHub Desktop.
created by https://github.com/tr3buchet/gister
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/circuits/protocols/irc/message.py b/circuits/protocols/irc/message.py | |
index 6d11e5f..fbc8604 100644 | |
--- a/circuits/protocols/irc/message.py | |
+++ b/circuits/protocols/irc/message.py | |
@@ -32,10 +32,10 @@ class Message(object): | |
return Message(command, *args, prefix=prefix) | |
- def __bytes__(self): | |
- return str(self).encode(self.encoding) | |
- | |
def __str__(self): | |
+ return unicode(self).encode(self.encoding) | |
+ | |
+ def __unicode__(self): | |
args = self.args[:] | |
for arg in args[:-1]: | |
if arg is not None and " " in arg: | |
@@ -44,14 +44,14 @@ class Message(object): | |
if len(args) > 0 and " " in args[-1]: | |
args[-1] = ":{0:s}".format(args[-1]) | |
- return "{prefix:s}{command:s} {args:s}\r\n".format( | |
+ return u"{prefix:s}{command:s} {args:s}\r\n".format( | |
prefix=( | |
- ":{0:s} ".format(self.prefix) | |
+ u":{0:s} ".format(self.prefix) | |
if self.prefix is not None | |
- else "" | |
+ else u"" | |
), | |
- command=str(self.command), | |
- args=" ".join(args) | |
+ command=unicode(self.command), | |
+ args=u" ".join(args) | |
) | |
def __repr__(self): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add/Replace the following lines: