diff options
author | Clayton Smith <argilo@gmail.com> | 2018-09-26 08:16:08 -0400 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-11-01 13:56:52 +0100 |
commit | bab3c3fbc1e4a0bc303b88077514144fd6e3a434 (patch) | |
tree | cba3a098c823f298e05dca691ac2fb2b5ba197a7 /docs | |
parent | 63d4bb4b47a2b66be05b16cf0164f3cd57ca92fa (diff) |
Fix invalid escape sequences.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/doxygen/other/doxypy.py | 24 | ||||
-rw-r--r-- | docs/sphinx/hieroglyph/test/test_comments.py | 5 |
2 files changed, 14 insertions, 15 deletions
diff --git a/docs/doxygen/other/doxypy.py b/docs/doxygen/other/doxypy.py index e474a9694f..c615a08f4a 100644 --- a/docs/doxygen/other/doxypy.py +++ b/docs/doxygen/other/doxypy.py @@ -97,22 +97,22 @@ class Doxypy(object): def __init__(self): string_prefixes = "[uU]?[rR]?" - self.start_single_comment_re = re.compile("^\s*%s(''')" % string_prefixes) - self.end_single_comment_re = re.compile("(''')\s*$") + self.start_single_comment_re = re.compile(r"^\s*%s(''')" % string_prefixes) + self.end_single_comment_re = re.compile(r"(''')\s*$") - self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes) - self.end_double_comment_re = re.compile("(\"\"\")\s*$") + self.start_double_comment_re = re.compile(r'^\s*%s(""")' % string_prefixes) + self.end_double_comment_re = re.compile(r'(""")\s*$') - self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes) - self.double_comment_re = re.compile("^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes) + self.single_comment_re = re.compile(r"^\s*%s(''').*(''')\s*$" % string_prefixes) + self.double_comment_re = re.compile(r'^\s*%s(""").*(""")\s*$' % string_prefixes) - self.defclass_re = re.compile("^(\s*)(def .+:|class .+:)") - self.empty_re = re.compile("^\s*$") - self.hashline_re = re.compile("^\s*#.*$") - self.importline_re = re.compile("^\s*(import |from .+ import)") + self.defclass_re = re.compile(r"^(\s*)(def .+:|class .+:)") + self.empty_re = re.compile(r"^\s*$") + self.hashline_re = re.compile(r"^\s*#.*$") + self.importline_re = re.compile(r"^\s*(import |from .+ import)") - self.multiline_defclass_start_re = re.compile("^(\s*)(def|class)(\s.*)?$") - self.multiline_defclass_end_re = re.compile(":\s*$") + self.multiline_defclass_start_re = re.compile(r"^(\s*)(def|class)(\s.*)?$") + self.multiline_defclass_end_re = re.compile(r":\s*$") ## Transition list format # ["FROM", "TO", condition, action] diff --git a/docs/sphinx/hieroglyph/test/test_comments.py b/docs/sphinx/hieroglyph/test/test_comments.py index 1cc569605c..1a26e50e48 100644 --- a/docs/sphinx/hieroglyph/test/test_comments.py +++ b/docs/sphinx/hieroglyph/test/test_comments.py @@ -269,7 +269,7 @@ All of the source sequence will be consumed. u' A Record which has a named attribute for each of the keyword arguments.', u''] - expected = """A convenience factory for creating Records. + expected = r"""A convenience factory for creating Records. :param \*\*kwargs: Each keyword argument will be used to initialise an attribute with the same name as the argument and the given @@ -382,7 +382,7 @@ All of the source sequence will be consumed. A Record which has a named attribute for each of the keyword arguments. """ - expected = """A convenience factory for creating Records. + expected = r"""A convenience factory for creating Records. :param \*\*kwargs: Each keyword argument will be used to initialise an attribute with the same name as the argument and the given @@ -584,4 +584,3 @@ All of the source sequence will be consumed. source_lines = source.splitlines() self.assertRaises(HieroglyphError, lambda: parse_hieroglyph_text(source_lines)) - |