Use chr instead of unichr
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 9 Jun 2013 15:32:36 +0000 (15:32 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sun, 9 Jun 2013 15:32:36 +0000 (15:32 +0000)
* lib/mudpy/misc.py: Missed in the earlier unicode to str patches, use
the chr function instead of unichr for Py3K compatibility.

lib/mudpy/misc.py

index 50d0269..2fe8e6f 100644 (file)
@@ -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