Skip to content

Commit

Permalink
pxdgen: use raw string
Browse files Browse the repository at this point in the history
also silence pylint about re.DOTALL
  • Loading branch information
TheJJ committed Jan 22, 2017
1 parent 576c7de commit d50e094
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions buildsystem/pxdgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def handle_multiline_comment(self, val):
the comment text, as string, including the '/*' and '*/'
"""
try:
val = re.match('^/\\*(.*)\\*/$', val, re.DOTALL).group(1)
# pylint: disable=no-member
val = re.match(r"^/\*(.*)\*/$", val, re.DOTALL).group(1)
except AttributeError as ex:
raise self.parser_error("invalid multi-line comment") from ex

Expand All @@ -115,7 +116,7 @@ def handle_multiline_comment(self, val):
comment_lines = []
for idx, line in enumerate(lines):
try:
line = re.match('^ \\*( (.*))?$', line).group(2) or ""
line = re.match(r'^ \*( (.*))?$', line).group(2) or ""
except AttributeError as ex:
raise self.parser_error("invalid multi-line comment line",
idx + self.lineno) from ex
Expand All @@ -131,7 +132,9 @@ def handle_comment(self, val):
Handles any comment, with its format characters removed,
extracting the pxd annotation
"""
annotations = re.findall('pxd:\\s(.*?)(:pxd|$)', val, re.DOTALL)

annotations = re.findall(r"pxd:\s(.*?)(:pxd|$)",
val, re.DOTALL) # pylint: disable=no-member
annotations = [annotation[0] for annotation in annotations]

if not annotations:
Expand Down

0 comments on commit d50e094

Please sign in to comment.