From bd96a6f7b7eb103f97bcd6eadc21908187e94dce Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 8 Jul 2020 11:51:48 +0300 Subject: Don't rely on Python's treatment of unrecognized escape sequences According to [1]: > Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning. > In a future Python version they will be a SyntaxWarning and eventually a SyntaxError. [1] https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals Change-Id: Ia4f79f17ccb121f423f35b1e1306d5ae285e8762 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98321 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Mike Kaganski --- bin/find-unused-defines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/find-unused-defines.py') diff --git a/bin/find-unused-defines.py b/bin/find-unused-defines.py index 8e708c4a055d..6ac190c02638 100755 --- a/bin/find-unused-defines.py +++ b/bin/find-unused-defines.py @@ -99,9 +99,9 @@ def in_exclusion_set( a ): return False; # find defines, excluding the externals folder -a = subprocess.Popen("git grep -hP '^#define\s+\w\w\w\w+\s*' -- \"[!e][!x][!t]*\" | sort -u", stdout=subprocess.PIPE, shell=True) +a = subprocess.Popen(r"git grep -hP '^#define\s+\w\w\w\w+\s*' -- \"[!e][!x][!t]*\" | sort -u", stdout=subprocess.PIPE, shell=True) -name_re = re.compile("#define\s+(\w+)") +name_re = re.compile(r"#define\s+(\w+)") with a.stdout as txt: for line in txt: idName = name_re.match(line).group(1) -- cgit