1.1 --- a/lib/__builtins__/unicode.py Sat Feb 04 00:10:47 2017 +0100
1.2 +++ b/lib/__builtins__/unicode.py Sat Feb 04 00:12:06 2017 +0100
1.3 @@ -89,6 +89,34 @@
1.4 else:
1.5 return result
1.6
1.7 + def _quote_value(self, b, n):
1.8 +
1.9 + "Append to 'b' the quoted form of 'n'."
1.10 +
1.11 + if n < 0:
1.12 + n += 256
1.13 +
1.14 + if n > 0xffff:
1.15 + b.append("\\U")
1.16 + digits = 8
1.17 + elif n > 0xff:
1.18 + b.append("\\u")
1.19 + digits = 4
1.20 + else:
1.21 + b.append("\\x")
1.22 + digits = 2
1.23 +
1.24 + x = hex(n, "")
1.25 + i = len(x)
1.26 +
1.27 + while i < digits:
1.28 + b.append("0")
1.29 + i += 1
1.30 +
1.31 + b.append(x)
1.32 +
1.33 + # Operator methods.
1.34 +
1.35 def __iadd__(self, other):
1.36
1.37 "Return a string combining this string with 'other'."