diff options
| author | Serge Guelton <sguelton@redhat.com> | 2019-02-11 15:03:17 +0000 |
|---|---|---|
| committer | Serge Guelton <sguelton@redhat.com> | 2019-02-11 15:03:17 +0000 |
| commit | 3331b6eab3976fbfa2afc196d37667036f3f4967 (patch) | |
| tree | 002d4146b3d95bc2bc573f300a13b09f64dfd7f0 /clang/tools/scan-build | |
| parent | 83e68854d54509e7536f32e4b4aa07e1ad25ec19 (diff) | |
| download | bcm5719-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')
| -rwxr-xr-x | clang/tools/scan-build/bin/set-xcode-analyzer | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer b/clang/tools/scan-build/bin/set-xcode-analyzer index 8e674823ba6..c2a65c90859 100755 --- a/clang/tools/scan-build/bin/set-xcode-analyzer +++ b/clang/tools/scan-build/bin/set-xcode-analyzer @@ -42,7 +42,7 @@ def ModifySpec(path, isBuiltinAnalyzer, pathToChecker): if line.find("Static Analyzer") >= 0: foundAnalyzer = True else: - m = re.search('^(\s*ExecPath\s*=\s*")', line) + m = re.search(r'^(\s*ExecPath\s*=\s*")', line) if m: line = "".join([m.group(0), pathToChecker, '";\n']) # Do not modify further ExecPath's later in the xcspec. |

