Issue #22364: Improved some re error messages using regex for hints.

This commit is contained in:
Serhiy Storchaka 2015-03-25 21:03:47 +02:00
parent 7c316a181a
commit 632a77e6a3
6 changed files with 299 additions and 195 deletions

View file

@ -286,7 +286,7 @@ def _compile(pattern, flags):
if isinstance(pattern, _pattern_type):
if flags:
raise ValueError(
"Cannot process flags argument with a compiled pattern")
"cannot process flags argument with a compiled pattern")
return pattern
if not sre_compile.isstring(pattern):
raise TypeError("first argument must be string or compiled pattern")