Skip to content

Commit 065a3a0

Browse files
committed
Fix anomalous backslashes in strings
Python 3.8 emits a SyntaxWarning for a string with an anomalous backslash, e.g.: <unknown>:127: SyntaxWarning: invalid escape sequence \s Fix by adding the missing 'r' prefix. Change-Id: If9ad77c1e1707fa2432c8fc31eeb5e6d2d7200a5 Signed-off-by: Peter Kolbus <[email protected]>
1 parent 538f083 commit 065a3a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/license_expression/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class ExpressionParseError(ParseError, ExpressionError):
128128
# mapping of lowercase operator strings to an operator object
129129
OPERATORS = {'and': KW_AND, 'or': KW_OR, 'with': KW_WITH}
130130

131-
_simple_tokenizer = re.compile('''
131+
_simple_tokenizer = re.compile(r'''
132132
(?P<symop>[^\s\(\)]+)
133133
|
134134
(?P<space>\s+)

src/license_expression/_pyahocorasick.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def overlap(self, other):
608608

609609

610610
# tokenize to separate text from parens
611-
_tokenizer = re.compile('''
611+
_tokenizer = re.compile(r'''
612612
(?P<text>[^\s\(\)]+)
613613
|
614614
(?P<space>\s+)

0 commit comments

Comments
 (0)