You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Update regex matching to handle proper class escaping
On Python 3.12 it's throwing compile warnings on the regex compiles:
```
spdx/verify-spdx-headers:8: SyntaxWarning: invalid escape sequence '\s'
SPDX = re.compile(f'SPDX-License-Identifier:\s+({SLUG.pattern})')
spdx/verify-spdx-headers:21: SyntaxWarning: invalid escape sequence '\s'
pattern = f"^{init}\s*{SPDX.pattern}\s*{fini}\\s*$"
spdx/verify-spdx-headers:21: SyntaxWarning: invalid escape sequence '\s'
pattern = f"^{init}\s*{SPDX.pattern}\s*{fini}\s*$"
```
This escapes the the '\s' to be '\\s' instead as that is compliant,
seems to compile correctly, and makes the warning go away. Quick
checking on my own repos seemed to not break anything.
Signed-off-by: John 'Warthog9' Hawley <[email protected]>
0 commit comments