From e1f33140d6281a7aaffc1ff59eb41d7c6730d73f Mon Sep 17 00:00:00 2001 From: Rustem Saiargaliev Date: Fri, 5 Nov 2021 16:34:57 +0100 Subject: [PATCH] Fix invalid syntax deprecation warning in regex Solve `DeprecationWarning: invalid escape sequence '\%'` --- pytest_translations/po_spelling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_translations/po_spelling.py b/pytest_translations/po_spelling.py index 9fe3278..2dc4f34 100644 --- a/pytest_translations/po_spelling.py +++ b/pytest_translations/po_spelling.py @@ -79,7 +79,7 @@ def runtest(self): # 1. replace everything between curly braces text = re.sub('{.*?}', '', text) # 2. remove everything between %( and ) - text = re.sub('\%\(.*?\)', '', text) + text = re.sub(r'\%\(.*?\)', '', text) # 3. remove ­ html entity text = text.replace('­', '')