changeset 29142:c07be448028b

check-code: fix py3 complaint about \NNN being invalid unicode
author timeless <timeless@mozdev.org>
date Wed, 11 May 2016 01:56:08 +0000
parents ba8999547f81
children 8ed693ec5398
files contrib/check-code.py tests/test-check-py3-compat.t
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Thu May 05 09:12:26 2016 +0000
+++ b/contrib/check-code.py	Wed May 11 01:56:08 2016 +0000
@@ -103,7 +103,7 @@
     (r'tail -n', "don't use the '-n' option to tail, just use '-<num>'"),
     (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"),
     (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"),
-    (r'printf.*[^\\]\\([1-9]|0\d)', "don't use 'printf \NNN', use Python"),
+    (r'printf.*[^\\]\\([1-9]|0\d)', r"don't use 'printf \NNN', use Python"),
     (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
     (r'\$\(.*\)', "don't use $(expr), use `expr`"),
     (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
--- a/tests/test-check-py3-compat.t	Thu May 05 09:12:26 2016 +0000
+++ b/tests/test-check-py3-compat.t	Wed May 11 01:56:08 2016 +0000
@@ -37,7 +37,6 @@
 
 #if py3exe
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
-  contrib/check-code.py: invalid syntax: (unicode error) 'unicodeescape' codec can't decode bytes in position *-*: malformed \N character escape (<unknown>, line *) (glob)
   doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   hgext/automv.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
   hgext/blackbox.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)