Skip to content

Commit 107e9af

Browse files
committed
tools: fix regex strings in Python tools
1 parent 5092346 commit 107e9af

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

deps/v8/tools/gen-postmortem-metadata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def load_objects_from_file(objfilename, checktypes):
501501
#
502502
entries = typestr.split(',');
503503
for entry in entries:
504-
types[re.sub('\s*=.*', '', entry).lstrip()] = True;
504+
types[re.sub(r'\s*=.*', '', entry).lstrip()] = True;
505505
entries = torque_typestr.split('\\')
506506
for entry in entries:
507507
name = re.sub(r' *V\(|\).*', '', entry)
@@ -514,7 +514,7 @@ def load_objects_from_file(objfilename, checktypes):
514514
start = entry.find('(');
515515
end = entry.find(')', start);
516516
rest = entry[start + 1: end];
517-
args = re.split('\s*,\s*', rest);
517+
args = re.split(r'\s*,\s*', rest);
518518
typename = args[0]
519519
typeconst = args[1]
520520
types[typeconst] = True
@@ -617,7 +617,7 @@ def parse_field(call):
617617
idx = call.find('(');
618618
kind = call[0:idx];
619619
rest = call[idx + 1: len(call) - 1];
620-
args = re.split('\s*,\s*', rest);
620+
args = re.split(r'\s*,\s*', rest);
621621

622622
consts = [];
623623

@@ -718,7 +718,7 @@ def emit_set(out, consts):
718718

719719
# Fix up overzealous parses. This could be done inside the
720720
# parsers but as there are several, it's easiest to do it here.
721-
ws = re.compile('\s+')
721+
ws = re.compile(r'\s+')
722722
for const in consts:
723723
name = ws.sub('', const['name'])
724724
value = ws.sub('', str(const['value'])) # Can be a number.

tools/getsharedopensslhasquic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_has_quic(include_path):
1414
except OSError:
1515
return False
1616

17-
regex = '^#\s*define OPENSSL_INFO_QUIC'
17+
regex = r'^#\s*define OPENSSL_INFO_QUIC'
1818

1919
for line in f:
2020
if (re.match(regex, line)):

tools/js2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def ReadFile(filename):
9292

9393
CONFIG_GYPI_ID = 'config_raw'
9494

95-
SLUGGER_RE =re.compile('[.\-/]')
95+
SLUGGER_RE =re.compile(r'[.\-/]')
9696

9797
is_verbose = False
9898

tools/v8_gypfiles/GN-scraper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44
import os
55

6-
PLAIN_SOURCE_RE = re.compile('\s*"([^/$].+)"\s*')
6+
PLAIN_SOURCE_RE = re.compile(r'\s*"([^/$].+)"\s*')
77
def DoMain(args):
88
gn_filename, pattern = args
99
src_root = os.path.dirname(gn_filename)

0 commit comments

Comments
 (0)