Debian Codegraph @

debian/patches/re_raw_strings.patch

raw
1 --- a/utils/pylit/pylit.py
2 +++ b/utils/pylit/pylit.py
3 @@ -476,10 +476,10 @@
4 marker = self.code_block_marker
5 if marker == '::':
6 # the default marker may occur at the end of a text line
7 - self.marker_regexp = re.compile('^( *(?!\.\.).*)(::)([ \n]*)$')
8 + self.marker_regexp = re.compile(r'^( *(?!\.\.).*)(::)([ \n]*)$')
9 else:
10 # marker must be on a separate line
11 - self.marker_regexp = re.compile('^( *)(%s)(.*\n?)$' % marker)
12 + self.marker_regexp = re.compile(r'^( *)(%s)(.*\n?)$' % marker)
13
14 # .. _TextCodeConverter.__iter__:
15 #
16 @@ -1589,7 +1589,7 @@
17 # ::
18
19 firstlines = ' '.join(docstring.splitlines()[:2])
20 - match = re.search('coding[=:]\s*([-\w.]+)', firstlines)
21 + match = re.search(r'coding[=:]\s*([-\w.]+)', firstlines)
22 if match:
23 docencoding = match.group(1)
24 docstring = docstring.decode(docencoding)
25 --- a/bench/plot.py
26 +++ b/bench/plot.py
27 @@ -57,7 +57,7 @@
28 lines = open(benchlog, 'r').readlines()
29
30 benchmarks = {}
31 -pattern = "\((.*)\)\s+(.*)\s+(.*)\s+\"(.*)\""
32 +pattern = r"\((.*)\)\s+(.*)\s+(.*)\s+\"(.*)\""
33
34 # Extract data from logfile
35 print("Parsing %s..." % benchlog)
36 --- a/cmake/scripts/copy-test-demo-data.py
37 +++ b/cmake/scripts/copy-test-demo-data.py
38 @@ -31,7 +31,7 @@
39 "xml", "xml.gz", "off", "inp", "msh", "supp", "rst",
40 "py.rst", "ele", "node", "grid", "edge", "sh"]
41
42 -suffix_pattern = re.compile("(%s)," % ("|".join("[\w-]+\.%s" % pattern
43 +suffix_pattern = re.compile("(%s)," % ("|".join(r"[\w-]+\.%s" % pattern
44 for pattern in suffix_patterns)))
45
46 script_rel_path = os.sep.join(__file__.split(os.sep)[:-1])
47 --- a/python/dolfin_utils/meshconvert/meshconvert.py
48 +++ b/python/dolfin_utils/meshconvert/meshconvert.py
49 @@ -506,7 +506,7 @@
50 if state == 10:
51 print("Conversion done")
52 else:
53 - _error("Missing data, unable to convert \n\ Did you use version 2.0 of the gmsh file format?")
54 + _error("Missing data, unable to convert. Did you use version 2.0 of the gmsh file format?")
55
56 # Close files
57 ifile.close()
58 @@ -862,7 +862,7 @@
59 for i in range(num_vertices):
60 line = ifile.readline()
61 m = re.match(r"^.*\(\s*(.*)\s*\).*\](.*)$", line)
62 - x = list(map(float, re.split("[\s,]+", m.group(1))))
63 + x = list(map(float, re.split(r"[\s,]+", m.group(1))))
64 xml_writer.write_vertex(ofile, i, *x)
65 markers = list(map(int, m.group(2).split()))
66 vertex_markers.append(markers)
67 @@ -1184,11 +1184,11 @@
68 if not line:
69 _error("Empty file")
70 if re.search(r"num_dim.*=", line):
71 - dim = int(re.match(".*\s=\s(\d+)\s;",line).group(1))
72 + dim = int(re.match(r".*\s=\s(\d+)\s;",line).group(1))
73 if re.search(r"num_nodes.*=", line):
74 - num_vertices = int(re.match(".*\s=\s(\d+)\s;",line).group(1))
75 + num_vertices = int(re.match(r".*\s=\s(\d+)\s;",line).group(1))
76 if re.search(r"num_elem.*=", line):
77 - num_cells = int(re.match(".*\s=\s(\d+)\s;",line).group(1))
78 + num_cells = int(re.match(r".*\s=\s(\d+)\s;",line).group(1))
79 if re.search(r"connect1 =",line):
80 break
81
82 @@ -1215,7 +1215,7 @@
83 line = ifile.readline()
84 if not line:
85 break
86 - connect=re.split("[,;]",line)
87 + connect=re.split(r"[,;]",line)
88 if num_dims == 2:
89 n0 = int(connect[0])-1
90 n1 = int(connect[1])-1