mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Issue #22364: Improved some re error messages using regex for hints.
This commit is contained in:
parent
7c316a181a
commit
632a77e6a3
6 changed files with 299 additions and 195 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue