Page MenuHomePhabricator

[tools] Fix python DeprecationWarning: invalid escape sequence
ClosedPublic

Authored by MarcoFalke on Jan 31 2019, 10:58 AM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

MarcoFalke created this revision.Jan 31 2019, 10:58 AM

LGTM, do you have commit right?

This revision is now accepted and ready to land.Feb 11 2019, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 12:20 AM

No, I don't have commit right

Closed by commit rL353707: [tools] Fix python DeprecationWarning: invalid escape sequence (authored by serge_sans_paille, committed by ). · Explain WhyFeb 11 2019, 7:03 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 7:03 AM

@MarcoFalke it's in, thanks for the patch o/