Skip to content

Commit 6edc6fc

Browse files
authored
Merge pull request #4536 from mwichmann/SConsExamples
Fix some more regex strings
2 parents ea5a851 + 9f0e847 commit 6edc6fc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

bin/SConsExamples.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def process(source_file, ofp):
554554
process(src, fp)
555555
fp.write('debug = ' + ARGUMENTS.get('debug', '0') + '\\n')
556556
557-
public_class_re = re.compile('^public class (\S+)', re.MULTILINE)
557+
public_class_re = re.compile(r'^public class (\S+)', re.MULTILINE)
558558
559559
def JavaCCom(target, source, env):
560560
# This is a fake Java compiler that just looks for

bin/scons-diff.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def comma(x1, x2):
115115

116116
diff_function = diff_map.get(diff_type, simple_diff)
117117

118-
baseline_re = re.compile('(# |@REM )/home/\S+/baseline/')
119-
comment_rev_re = re.compile('(# |@REM )(\S+) 0.96.[CD]\d+ \S+ \S+( knight)')
120-
revision_re = re.compile('__revision__ = "[^"]*"')
121-
build_re = re.compile('__build__ = "[^"]*"')
122-
date_re = re.compile('__date__ = "[^"]*"')
118+
baseline_re = re.compile(r'(# |@REM )/home/\S+/baseline/')
119+
comment_rev_re = re.compile(r'(# |@REM )(\S+) 0.96.[CD]\d+ \S+ \S+( knight)')
120+
revision_re = re.compile(r'__revision__ = "[^"]*"')
121+
build_re = re.compile(r'__build__ = "[^"]*"')
122+
date_re = re.compile(r'__date__ = "[^"]*"')
123123

124124
def lines_read(file):
125125
return open(file).readlines()

bin/scons-time.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def find_next_run_number(self, dir, prefix):
552552
specified prefix, extracts the run numbers from each file name,
553553
and returns the next run number after the largest it finds.
554554
"""
555-
x = re.compile(re.escape(prefix) + '-([0-9]+).*')
555+
x = re.compile(re.escape(prefix) + r'-([0-9]+).*')
556556
matches = [x.match(e) for e in os.listdir(dir)]
557557
matches = [_f for _f in matches if _f]
558558
if not matches:

0 commit comments

Comments
 (0)