From 8facc4e910d3f936befefe115f25827a82e0c846 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Fri, 7 Oct 2016 07:43:04 -0400 Subject: [PATCH] hgmanpage: stop using raw-unicode strings These don't exist in Python 3, and this ends up looking a little more explicit to Martijn and me anyway. --- doc/hgmanpage.py | 8 ++++---- tests/test-check-py3-compat.t | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/hgmanpage.py b/doc/hgmanpage.py index 35a5a10eaf..df32204d2f 100644 --- a/doc/hgmanpage.py +++ b/doc/hgmanpage.py @@ -288,10 +288,10 @@ class Translator(nodes.NodeVisitor): text = node.astext() text = text.replace('\\','\\e') replace_pairs = [ - (u'-', ur'\-'), - (u'\'', ur'\(aq'), - (u'´', ur'\''), - (u'`', ur'\(ga'), + (u'-', u'\\-'), + (u"'", u'\\(aq'), + (u'´', u"\\'"), + (u'`', u'\\(ga'), ] for (in_char, out_markup) in replace_pairs: text = text.replace(in_char, out_markup) diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t index c81f711899..1e313f7b37 100644 --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -16,7 +16,6 @@ $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \ > | xargs $PYTHON3 contrib/check-py3-compat.py \ > | sed 's/[0-9][0-9]*)$/*)/' - doc/hgmanpage.py: invalid syntax: invalid syntax (, line *) hgext/acl.py: error importing: Can't mix strings and bytes in path components (error at i18n.py:*) hgext/automv.py: error importing: Can't mix strings and bytes in path components (error at i18n.py:*) hgext/blackbox.py: error importing: Can't mix strings and bytes in path components (error at i18n.py:*)