Fix selftest telopt callback for Python 3.4
[mudpy.git] / mudpy / tests / selftest.py
index 2cbed03..202778a 100644 (file)
@@ -181,7 +181,7 @@ test_telnet_iac = (
     # unescaped and deduplicated to a single \xff in the buffer and then
     # the line of input discarded as a non-ASCII sequence
     (2, "> ", b"say argle\xff\xffbargle\r\0"),
-    (2, r"Non-ASCII characters from admin: b'say argle\\xffbargle'.*> ", ""),
+    (2, r"Non-ASCII characters from admin: b'say.*argle\\xffbargle'.*> ", ""),
 )
 
 test_telnet_unknown_command = (
@@ -432,9 +432,9 @@ def option_callback(telnet_socket, command, option):
         # any response to avoid endlessly looping
         pass
     elif command in (telnetlib.DO, telnetlib.DONT):
-        telnet_socket.send(b"%s%s%s" % (telnetlib.IAC, telnetlib.WONT, option))
+        telnet_socket.send(telnetlib.IAC + telnetlib.WONT + option)
     elif command in (telnetlib.WILL, telnetlib.WONT):
-        telnet_socket.send(b"%s%s%s" % (telnetlib.IAC, telnetlib.DONT, option))
+        telnet_socket.send(telnetlib.IAC + telnetlib.DONT + option)
 
 
 def main():