mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Addendum to #764548: restore 2.1 compatibility.
This commit is contained in:
parent
12723bacea
commit
74902508dc
2 changed files with 9 additions and 3 deletions
|
|
@ -221,7 +221,7 @@ def _compile(*key):
|
|||
pattern, flags = key
|
||||
if isinstance(pattern, _pattern_type):
|
||||
return pattern
|
||||
if not isinstance(pattern, sre_compile.STRING_TYPES):
|
||||
if not sre_compile.isstring(pattern):
|
||||
raise TypeError, "first argument must be string or compiled pattern"
|
||||
try:
|
||||
p = sre_compile.compile(pattern, flags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue