##// END OF EJS Templates
util: pass encoding.[encoding|encodingmode] as unicodes...
Pulkit Goyal -
r31338:a9a28ca1 default
parent child Browse files
Show More
@@ -2241,13 +2241,16 b" def wrap(line, width, initindent='', han"
2241 if width <= maxindent:
2241 if width <= maxindent:
2242 # adjust for weird terminal size
2242 # adjust for weird terminal size
2243 width = max(78, maxindent + 1)
2243 width = max(78, maxindent + 1)
2244 line = line.decode(encoding.encoding, encoding.encodingmode)
2244 line = line.decode(pycompat.sysstr(encoding.encoding),
2245 initindent = initindent.decode(encoding.encoding, encoding.encodingmode)
2245 pycompat.sysstr(encoding.encodingmode))
2246 hangindent = hangindent.decode(encoding.encoding, encoding.encodingmode)
2246 initindent = initindent.decode(pycompat.sysstr(encoding.encoding),
2247 pycompat.sysstr(encoding.encodingmode))
2248 hangindent = hangindent.decode(pycompat.sysstr(encoding.encoding),
2249 pycompat.sysstr(encoding.encodingmode))
2247 wrapper = MBTextWrapper(width=width,
2250 wrapper = MBTextWrapper(width=width,
2248 initial_indent=initindent,
2251 initial_indent=initindent,
2249 subsequent_indent=hangindent)
2252 subsequent_indent=hangindent)
2250 return wrapper.fill(line).encode(encoding.encoding)
2253 return wrapper.fill(line).encode(pycompat.sysstr(encoding.encoding))
2251
2254
2252 if (pyplatform.python_implementation() == 'CPython' and
2255 if (pyplatform.python_implementation() == 'CPython' and
2253 sys.version_info < (3, 0)):
2256 sys.version_info < (3, 0)):
General Comments 0
You need to be logged in to leave comments. Login now