From 81830cc77047ce39eab056a70b44a2d97848550c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 27 Mar 2022 23:58:39 +0900 Subject: [PATCH] Fix a flake8 warning --- sphinx/ext/extlinks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py index a574d665af1..659a92b799c 100644 --- a/sphinx/ext/extlinks.py +++ b/sphinx/ext/extlinks.py @@ -72,7 +72,8 @@ def check_uri(self, refnode: nodes.reference) -> None: for alias, (base_uri, _caption) in self.app.config.extlinks.items(): if sys.version_info < (3, 7): - # Replace a leading backslash because re.escape() inserts a backslash before % on python 3.6 + # Replace a leading backslash because re.escape() inserts a backslash before % + # on python 3.6 uri_pattern = re.compile(re.escape(base_uri).replace('\\%s', '(?P.+)')) else: uri_pattern = re.compile(re.escape(base_uri).replace('%s', '(?P.+)'))