Skip to content

Commit a09564a

Browse files
rustyrussellt-bast
authored andcommitted
tools/extract-formats: suppress modern Python warnings.
It complains about escapes unless we tell it it's a regex: ``` /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:27: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:29: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:31: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:33: SyntaxWarning: invalid escape sequence '\s' '\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:35: SyntaxWarning: invalid escape sequence '\.' '(2\.|\*) data:') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:37: SyntaxWarning: invalid escape sequence '\.' '(2\.|\*) types:') ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent 7910106 commit a09564a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/extract-formats.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424

2525
# We allow either ordered or unordered lists.
2626
typeline = re.compile(
27-
'(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?')
27+
r'(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?')
2828
tlvline = re.compile(
29-
'(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`')
29+
r'(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`')
3030
subtypeline = re.compile(
31-
'(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`')
31+
r'(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`')
3232
dataline = re.compile(
33-
'\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]')
33+
r'\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]')
3434
datastartline = re.compile(
35-
'(2\.|\*) data:')
35+
r'(2\.|\*) data:')
3636
tlvtypesline = re.compile(
37-
'(2\.|\*) types:')
37+
r'(2\.|\*) types:')
3838

3939
# Generator to give us one line at a time.
4040
def next_line(args, lines):

0 commit comments

Comments
 (0)