Skip to content

Conversation

tex3d
Copy link
Contributor

@tex3d tex3d commented Jun 3, 2025

This fixes some long-standing errors reported from lit/TestRunner.py due to a need to specify r for raw strings for a few regular expressions that contain invalid escape sequences otherwise.

Copy link
Contributor

github-actions bot commented Jun 3, 2025

✅ With the latest revision this PR passed the Python code formatter.

@tex3d tex3d changed the title Fix python literal string errors in TestRunner.py NFC: Fix python literal string errors in TestRunner.py Jun 3, 2025
Comment on lines +441 to +443
re_cond_end = re.compile("%{")
re_if = re.compile("(.*?)(?:%if)")
re_nested_if = re.compile("(.*?)(?:%if|%})")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use raw strings for all of these for consistency? I think it's more or less a best practice to always use raw strings for the input to re. functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

3 participants