mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 09:15:34 +00:00
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>
This commit is contained in:
parent
04b818dd4c
commit
8916953b53
@ -96,7 +96,7 @@ replace_vars = {
|
|||||||
|
|
||||||
# extract version information, installation location, other stuff we need to
|
# extract version information, installation location, other stuff we need to
|
||||||
# use when building final documents
|
# use when building final documents
|
||||||
val = re.compile('^S\["([^"]+)"\]="(.*)"$')
|
val = re.compile(r'^S\["([^"]+)"\]="(.*)"$')
|
||||||
try:
|
try:
|
||||||
with open("../../config.status", "r") as cfgstatus:
|
with open("../../config.status", "r") as cfgstatus:
|
||||||
for ln in cfgstatus.readlines():
|
for ln in cfgstatus.readlines():
|
||||||
|
@ -91,7 +91,7 @@ replace_vars = {
|
|||||||
|
|
||||||
# extract version information, installation location, other stuff we need to
|
# extract version information, installation location, other stuff we need to
|
||||||
# use when building final documents
|
# use when building final documents
|
||||||
val = re.compile('^S\["([^"]+)"\]="(.*)"$')
|
val = re.compile(r'^S\["([^"]+)"\]="(.*)"$')
|
||||||
try:
|
try:
|
||||||
with open("../../config.status", "r") as cfgstatus:
|
with open("../../config.status", "r") as cfgstatus:
|
||||||
for ln in cfgstatus.readlines():
|
for ln in cfgstatus.readlines():
|
||||||
|
@ -96,7 +96,7 @@ replace_vars = {
|
|||||||
|
|
||||||
# extract version information, installation location, other stuff we need to
|
# extract version information, installation location, other stuff we need to
|
||||||
# use when building final documents
|
# use when building final documents
|
||||||
val = re.compile('^S\["([^"]+)"\]="(.*)"$')
|
val = re.compile(r'^S\["([^"]+)"\]="(.*)"$')
|
||||||
try:
|
try:
|
||||||
with open("../../config.status", "r") as cfgstatus:
|
with open("../../config.status", "r") as cfgstatus:
|
||||||
for ln in cfgstatus.readlines():
|
for ln in cfgstatus.readlines():
|
||||||
|
@ -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("--warn-empty", action="store_const", const=True)
|
||||||
argp.add_argument("--pipe", 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 = [
|
ignore = [
|
||||||
lambda fn: fn.startswith("tools/"),
|
lambda fn: fn.startswith("tools/"),
|
||||||
|
@ -91,7 +91,7 @@ lines = before.splitlines()
|
|||||||
autoderp = "#AUTODERP# "
|
autoderp = "#AUTODERP# "
|
||||||
out_lines = []
|
out_lines = []
|
||||||
bcdeps = []
|
bcdeps = []
|
||||||
make_rule_re = re.compile("^([^:\s]+):\s*([^:\s]+)\s*($|\n)")
|
make_rule_re = re.compile(r"^([^:\s]+):\s*([^:\s]+)\s*($|\n)")
|
||||||
|
|
||||||
while lines:
|
while lines:
|
||||||
line = lines.pop(0)
|
line = lines.pop(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user