bpo-30605: Fix compiling binary regexs with BytesWarnings enabled. (#2016)

Running our unit tests with `-bb` enabled triggered this failure.
This commit is contained in:
Roy Williams 2017-06-09 22:01:16 -07:00 committed by Serhiy Storchaka
parent 7445381c60
commit 171b9a354e
4 changed files with 19 additions and 3 deletions

View file

@ -765,7 +765,7 @@ def _parse(source, state, verbose, nested, first=False):
if not first or subpattern:
import warnings
warnings.warn(
'Flags not at the start of the expression %s%s' % (
'Flags not at the start of the expression %r%s' % (
source.string[:20], # truncate long regexes
' (truncated)' if len(source.string) > 20 else '',
),