diff options
| -rw-r--r-- | passlib/tests/utils.py | 4 | ||||
| -rw-r--r-- | passlib/utils/compat.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/passlib/tests/utils.py b/passlib/tests/utils.py index ff6dea8..06aea3c 100644 --- a/passlib/tests/utils.py +++ b/passlib/tests/utils.py @@ -37,7 +37,7 @@ from passlib import registry, utils from passlib.utils import classproperty, handlers as uh, \ has_rounds_info, has_salt_info, MissingBackendError, \ rounds_cost_values, b, bytes, native_str, NoneType -from passlib.utils.compat import iteritems, irange, callable +from passlib.utils.compat import iteritems, irange, callable, sb_types #local __all__ = [ #util funcs @@ -298,7 +298,7 @@ class TestCase(unittest.TestCase): #added in 2.7/UT2 and 3.1 def assertRegexpMatches(self, text, expected_regex, msg=None): """Fail the test unless the text matches the regular expression.""" - if isinstance(expected_regex, basestring): + if isinstance(expected_regex, sb_types): assert expected_regex, "expected_regex must not be empty." expected_regex = re.compile(expected_regex) if not expected_regex.search(text): diff --git a/passlib/utils/compat.py b/passlib/utils/compat.py index 805f8b9..c98f8d4 100644 --- a/passlib/utils/compat.py +++ b/passlib/utils/compat.py @@ -59,6 +59,8 @@ else: __all__.append("bytes") # string_types = (unicode,str) +sb_types = (unicode, bytes) + #============================================================================= # bytes-specific helpers #============================================================================= |
