summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build-py/libscanbuild/analyze.py
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@redhat.com>2019-02-11 15:03:17 +0000
committerSerge Guelton <sguelton@redhat.com>2019-02-11 15:03:17 +0000
commit3331b6eab3976fbfa2afc196d37667036f3f4967 (patch)
tree002d4146b3d95bc2bc573f300a13b09f64dfd7f0 /clang/tools/scan-build-py/libscanbuild/analyze.py
parent83e68854d54509e7536f32e4b4aa07e1ad25ec19 (diff)
downloadbcm5719-llvm-3331b6eab3976fbfa2afc196d37667036f3f4967.tar.gz
bcm5719-llvm-3331b6eab3976fbfa2afc196d37667036f3f4967.zip
[tools] Fix python DeprecationWarning: invalid escape sequence
The python documentation says "it’s highly recommended that you use raw strings for all but the simplest expressions." (https://docs.python.org/3/library/re.html) So do that with the attached patch generated by sed -i -e "s/re.search('/re.search(r'/g" $(git grep -l 're.search(') The warning can be seen in e.g. python3.7: $ python3.7 -Wd >>> import re; re.search('\s', '') <stdin>:1: DeprecationWarning: invalid escape sequence \s Commited on behalf of Marco Falke. Differential Revision: https://reviews.llvm.org/D57528 llvm-svn: 353707
Diffstat (limited to 'clang/tools/scan-build-py/libscanbuild/analyze.py')
-rw-r--r--clang/tools/scan-build-py/libscanbuild/analyze.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/scan-build-py/libscanbuild/analyze.py b/clang/tools/scan-build-py/libscanbuild/analyze.py
index bac259cde2d..49de387c704 100644
--- a/clang/tools/scan-build-py/libscanbuild/analyze.py
+++ b/clang/tools/scan-build-py/libscanbuild/analyze.py
@@ -97,7 +97,7 @@ def need_analyzer(args):
when compiler wrappers are used. That's the moment when build setup
check the compiler and capture the location for the build process. """
- return len(args) and not re.search('configure|autogen', args[0])
+ return len(args) and not re.search(r'configure|autogen', args[0])
def prefix_with(constant, pieces):
OpenPOWER on IntegriCloud