Addendum to #764548: restore 2.1 compatibility.

This commit is contained in:
Just van Rossum 2003-07-02 21:37:16 +00:00
parent 12723bacea
commit 74902508dc
2 changed files with 9 additions and 3 deletions

View file

@ -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)