Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

h-vetinari
Copy link
Contributor

Unless specified as a "raw" string, Python will try to interpret backslashes, which means they don't get passed on correctly to the underlying regex-engine, unless escaped manually (\\).

Use raw strings in llvm/test/lit.cfg.py to avoid a SyntaxWarning:

llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)

Other such warning present in 17.0.x were already fixed in 7ed0f5b.

Unless specified as a "raw" string, Python will try to interpret
backslashes, which means they don't get passed on correctly to the
underlying regex-engine, unless escaped manually (`\\`).

Use raw strings in `llvm/test/lit.cfg.py` to avoid a `SyntaxWarning`:
```
llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)
```

Other such warning present in 17.0.x were already fixed in 7ed0f5b.
@h-vetinari
Copy link
Contributor Author

@llvm/pr-subscribers-testing-tools
The only file touched by this PR does not seem to be covered by either codeowners or the PR labeler, and there's no team (that I could find) for lit/llvm-lit directly. Based on other PRs having the llvm-lit label, I hope I'm tagging the right target audience 😅

@jh7370 jh7370 requested a review from jdenny-ornl November 6, 2023 07:11
Copy link
Contributor

@RoboTux RoboTux left a comment

Choose a reason for hiding this comment

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

LGTM. Regarding who should be code owner I'm not sure, generally I would say it should be whoever is also owner for the tests as the file's content has more to do with the tests than lit in terms of why it's there. Since it might affect NVPTX tests, maybe some NVPTX backend owner.

@h-vetinari
Copy link
Contributor Author

I don't have rights to merge here, could someone push the button?

@h-vetinari
Copy link
Contributor Author

Gentle ping @llvm/pr-subscribers-testing-tools

@RoboTux RoboTux merged commit 43af73f into llvm:main Nov 20, 2023
@RoboTux
Copy link
Contributor

RoboTux commented Nov 20, 2023

Gentle ping @llvm/pr-subscribers-testing-tools

Sorry about that. Merged.

@h-vetinari h-vetinari deleted the raw branch November 20, 2023 10:11
@h-vetinari
Copy link
Contributor Author

no worries, thanks for merging!

sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
…vm#70907)

Unless specified as a "raw" string, Python will try to interpret
backslashes, which means they don't get passed on correctly to the
underlying regex-engine, unless escaped manually (`\\`).

Use raw strings in `llvm/test/lit.cfg.py` to avoid a `SyntaxWarning`:
```
llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)
```

Other such warning present in 17.0.x were already fixed in
7ed0f5b.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
…vm#70907)

Unless specified as a "raw" string, Python will try to interpret
backslashes, which means they don't get passed on correctly to the
underlying regex-engine, unless escaped manually (`\\`).

Use raw strings in `llvm/test/lit.cfg.py` to avoid a `SyntaxWarning`:
```
llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)
```

Other such warning present in 17.0.x were already fixed in
7ed0f5b.
Guzhu-AMD pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Nov 23, 2023
Local branch amd-gfx bedf99a Merged main:3f743fd3a319 into amd-gfx:fa9cd7924a4e
Remote branch main 43af73f [lit] Use raw strings for backslash escapes to fix SyntaxWarnings (llvm#70907)
nilanjana87 pushed a commit to nilanjana87/llvm-project that referenced this pull request Nov 28, 2023
…vm#70907)

Unless specified as a "raw" string, Python will try to interpret
backslashes, which means they don't get passed on correctly to the
underlying regex-engine, unless escaped manually (`\\`).

Use raw strings in `llvm/test/lit.cfg.py` to avoid a `SyntaxWarning`:
```
llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)
```

Other such warning present in 17.0.x were already fixed in
7ed0f5b.
zeroomega pushed a commit to zeroomega/llvm-project that referenced this pull request Feb 28, 2024
…vm#70907)

Unless specified as a "raw" string, Python will try to interpret
backslashes, which means they don't get passed on correctly to the
underlying regex-engine, unless escaped manually (`\\`).

Use raw strings in `llvm/test/lit.cfg.py` to avoid a `SyntaxWarning`:
```
llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d'
  match = re.search("release (\d+)\.(\d+)", ptxas_out)
```

Other such warning present in 17.0.x were already fixed in
7ed0f5b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants