Fix invalid escape sequences in regex (#1814)

This commit is contained in:
Oxan van Leeuwen 2021-07-05 00:04:18 +02:00 committed by GitHub
parent 86ac7f3a59
commit 4c4099966a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,8 +205,7 @@ def maybe_simple_message(schema):
def validate_printf(value): def validate_printf(value):
# https://stackoverflow.com/questions/30011379/how-can-i-parse-a-c-format-string-in-python # https://stackoverflow.com/questions/30011379/how-can-i-parse-a-c-format-string-in-python
# pylint: disable=anomalous-backslash-in-string cfmt = r"""
cfmt = """\
( # start of capture group 1 ( # start of capture group 1
% # literal "%" % # literal "%"
(?:[-+0 #]{0,5}) # optional flags (?:[-+0 #]{0,5}) # optional flags