timbertson / gup

A better make, inspired by djb's redo.
GNU Lesser General Public License v2.1
51 stars 5 forks source link

New warning about invalid escape sequence \s #22

Closed michelschinz closed 7 months ago

michelschinz commented 7 months ago

Hello,

After upgrading Python to 3.12.2, I get the following warning when running gup:

gup:1068: SyntaxWarning: invalid escape sequence '\s'

the line in question reads:

new_rule = not re.match('^\s', line)

and the fix is probably just to use a raw string:

new_rule = not re.match(r'^\s', line)

I've applied that change to my version of gup, and it seems to work.

timbertson commented 7 months ago

Thanks for letting me know 👍