changeset 41554:17a6e063c886

run-tests: use raw strings for regular expressions Avoids SyntaxWarning due to invalid \ escape on Python 3.8. Differential Revision: https://phab.mercurial-scm.org/D5825
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 04 Feb 2019 09:32:30 -0800
parents 45a4789d3ff2
children 595a67a301ee
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Feb 04 09:31:19 2019 -0800
+++ b/tests/run-tests.py	Mon Feb 04 09:32:30 2019 -0800
@@ -634,7 +634,7 @@
 # list in group 2, and the preceeding line output in group 1:
 #
 #   output..output (feature !)\n
-optline = re.compile(b'(.*) \((.+?) !\)\n$')
+optline = re.compile(br'(.*) \((.+?) !\)\n$')
 
 def cdatasafe(data):
     """Make a string safe to include in a CDATA block.
@@ -3112,8 +3112,8 @@
             # installation layout put it in bin/ directly. Fix it
             with open(hgbat, 'rb') as f:
                 data = f.read()
-            if b'"%~dp0..\python" "%~dp0hg" %*' in data:
-                data = data.replace(b'"%~dp0..\python" "%~dp0hg" %*',
+            if br'"%~dp0..\python" "%~dp0hg" %*' in data:
+                data = data.replace(br'"%~dp0..\python" "%~dp0hg" %*',
                                     b'"%~dp0python" "%~dp0hg" %*')
                 with open(hgbat, 'wb') as f:
                     f.write(data)