This is an archive of the discontinued LLVM Phabricator instance.

[lit] Use raw strings for backslash escapes to fix SyntaxWarnings
ClosedPublic

Authored by mgorny on Aug 19 2023, 11:51 PM.

Details

Summary

Use raw strings instead of regular strings when escapes are used for
regex matches or arbitrary letters rather than C-style characters.
This fixes SyntaxWarnings:

TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'
  """
TestRunner.py:1566: SyntaxWarning: invalid escape sequence '\s'
  match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)

Diff Detail

Event Timeline

mgorny created this revision.Aug 19 2023, 11:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2023, 11:51 PM
Herald added a subscriber: delcypher. · View Herald Transcript
mgorny requested review of this revision.Aug 19 2023, 11:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2023, 11:51 PM
MaskRay accepted this revision.EditedAug 20 2023, 11:15 AM

D122569 (@asavonic) introduced the issue.

This revision is now accepted and ready to land.Aug 20 2023, 11:15 AM
This revision was landed with ongoing or failed builds.Aug 20 2023, 6:51 PM
This revision was automatically updated to reflect the committed changes.