diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2024-07-23 10:21:42 -0700 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2024-07-23 10:23:50 -0700 |
| commit | 8916953b534f64a7545860ad5b4b36dc2544f33a (patch) | |
| tree | 98fa71269f150691adbc58aee6d843e608029c64 /python/firstheader.py | |
| parent | 04b818dd4ca1b490da500aff5f40f07ff8e20396 (diff) | |
build: fix a few python string escape warnings
When using a regex (or anything that uses `\?` escapes) in python, raw
strings (`r"content"`) should be used so python doesn't consume the
escapes itself. Otherwise we get either broken behavior and/or
`SyntaxWarning: invalid escape sequence '\['`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'python/firstheader.py')
| -rw-r--r-- | python/firstheader.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/firstheader.py b/python/firstheader.py index 06e2895845..1a3cadfd5e 100644 --- a/python/firstheader.py +++ b/python/firstheader.py @@ -15,7 +15,7 @@ argp.add_argument("--autofix", action="store_const", const=True) argp.add_argument("--warn-empty", action="store_const", const=True) argp.add_argument("--pipe", action="store_const", const=True) -include_re = re.compile('^#\s*include\s+["<]([^ ">]+)[">]', re.M) +include_re = re.compile(r'^#\s*include\s+["<]([^ ">]+)[">]', re.M) ignore = [ lambda fn: fn.startswith("tools/"), |
