Skip to content

Commit

Permalink
Use proper regex escaping
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Ombredanne <[email protected]>
  • Loading branch information
pombredanne committed Aug 28, 2019
1 parent 478c761 commit a0f25d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spdx/parsers/tagvaluebuilders.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def checksum_from_sha1(value):
checksum or None if does not match CHECKSUM_RE.
"""
# More constrained regex at lexer level
CHECKSUM_RE = re.compile('SHA1:\s*([\S]+)', re.UNICODE)
CHECKSUM_RE = re.compile('SHA1:\\s*([\\S]+)', re.UNICODE)
match = CHECKSUM_RE.match(value)
if match:
return checksum.Algorithm(identifier='SHA1', value=match.group(1))
Expand Down

0 comments on commit a0f25d6

Please sign in to comment.