# HG changeset patch # User Augie Fackler # Date 2017-05-28 19:51:07 # Node ID 633c635a790ad75709e0e84256f4c1a1c7d27ca0 # Parent d770a08ee9d9c23dc4e467ae50bf221d3d6304d2 help: work around textwrap.dedent() only working on strings diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -266,7 +266,8 @@ def makeitemsdoc(ui, topic, doc, marker, continue text = gettext(text) if dedent: - text = textwrap.dedent(text) + # Abuse latin1 to use textwrap.dedent() on bytes. + text = textwrap.dedent(text.decode('latin1')).encode('latin1') lines = text.splitlines() doclines = [(lines[0])] for l in lines[1:]: