From 4c4bb9705871a769ef575ba5dbe1818d92176ee8 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 20 Dec 2024 11:59:40 -0500 Subject: [PATCH] Fix the regexs in the python code here to be raw strings. (#414) Otherwise we can get SyntaxWarnings on modern versions of Python. Signed-off-by: Chris Lalancette --- docutils_transforms_reps.py | 2 +- rep0/rep.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docutils_transforms_reps.py b/docutils_transforms_reps.py index e3db23b97..22f6fbd42 100644 --- a/docutils_transforms_reps.py +++ b/docutils_transforms_reps.py @@ -113,7 +113,7 @@ def apply(self): elif name in ('replaces', 'replaced-by', 'requires'): newbody = [] space = nodes.Text(' ') - for refrep in re.split(',?\s+', body.astext()): + for refrep in re.split(r',?\s+', body.astext()): repno = int(refrep) newbody.append(nodes.reference( refrep, refrep, diff --git a/rep0/rep.py b/rep0/rep.py index b86102731..768f352d1 100644 --- a/rep0/rep.py +++ b/rep0/rep.py @@ -229,7 +229,7 @@ def _parse_author(self, data): author_list = [] for regex in (angled, paren, simple): # Watch out for commas separating multiple names. - regex += u'(,\s*)?' + regex += r'(,\s*)?' for match in re.finditer(regex, data): # Watch out for suffixes like 'Jr.' when they are # comma-separated from the name and thus cause issues when