From: Jeremy Stanley Date: Sun, 9 Jun 2013 15:32:36 +0000 (+0000) Subject: Use chr instead of unichr X-Git-Tag: 0.0.1~265 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=248b078be3a9249a20db8de3860726e8a4ac57ac;p=mudpy.git Use chr instead of unichr * lib/mudpy/misc.py: Missed in the earlier unicode to str patches, use the chr function instead of unichr for Py3K compatibility. --- diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 50d0269..2fe8e6f 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -808,7 +808,7 @@ class User: "\r\n\r\n" ): output = "$(eol)" + output - output += eol + unichr(27) + "[0m" + output += eol + chr(27) + "[0m" # tack on a prompt if active if self.state == "active": @@ -1354,15 +1354,15 @@ def replace_macros(user, text, is_input=False): # a dict of replacement macros macros = { "eol": "\r\n", - "bld": unichr(27) + "[1m", - "nrm": unichr(27) + "[0m", - "blk": unichr(27) + "[30m", - "blu": unichr(27) + "[34m", - "cyn": unichr(27) + "[36m", - "grn": unichr(27) + "[32m", - "mgt": unichr(27) + "[35m", - "red": unichr(27) + "[31m", - "yel": unichr(27) + "[33m", + "bld": chr(27) + "[1m", + "nrm": chr(27) + "[0m", + "blk": chr(27) + "[30m", + "blu": chr(27) + "[34m", + "cyn": chr(27) + "[36m", + "grn": chr(27) + "[32m", + "mgt": chr(27) + "[35m", + "red": chr(27) + "[31m", + "yel": chr(27) + "[33m", } # add dynamic macros where possible