From f2b077be8058ae19b8018ba2b844a8b902e1e37c Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 14 Sep 2016 20:50:32 +0200 Subject: Proper python3 support. --- miniircd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/miniircd b/miniircd index bf4d443..558d0d2 100755 --- a/miniircd +++ b/miniircd @@ -163,8 +163,8 @@ class Client(object): if len(x[1]) > 0 and x[1][0] == ":": arguments = [x[1][1:]] else: - y = string.split(x[1], " :", 1) - arguments = string.split(y[0]) + y = x[1].split(" :", 1) + arguments = y[0].split() if len(y) == 2: arguments.append(y[1]) self.__handle_command(command, arguments) @@ -547,7 +547,7 @@ class Client(object): data = "" quitmsg = x if data: - self.__readbuffer += data + self.__readbuffer += data.decode() self.__parse_read_buffer() self.__timestamp = time.time() self.__sent_ping = False @@ -556,7 +556,7 @@ class Client(object): def socket_writable_notification(self): try: - sent = self.socket.send(self.__writebuffer) + sent = self.socket.send(self.__writebuffer.encode()) self.server.print_debug( "[%s:%d] <- %r" % ( self.host, self.port, self.__writebuffer[:sent])) @@ -875,7 +875,7 @@ _ircstring_translation = _maketrans( def irc_lower(s): - return string.translate(s, _ircstring_translation) + return s.translate(_ircstring_translation) def main(argv): -- cgit v1.2.3