diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2016-08-23 13:13:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 13:13:44 -0700 |
commit | a22909c226eecd4632de45c04607ebddfeb96a19 (patch) | |
tree | edd4e9276d354ac44c97855a8cd97547f05c700e /test/units | |
parent | a695e18615792b50b24f1b5b5e80ca479fbb74a5 (diff) | |
download | ansible-a22909c226eecd4632de45c04607ebddfeb96a19.tar.gz |
Migrate basestring to a python3 compatible type (#17199)
Diffstat (limited to 'test/units')
-rw-r--r-- | test/units/module_utils/test_database.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/units/module_utils/test_database.py b/test/units/module_utils/test_database.py index 67da0b60e0..c8d6640297 100644 --- a/test/units/module_utils/test_database.py +++ b/test/units/module_utils/test_database.py @@ -3,16 +3,18 @@ import mock import os import re + from nose.tools import eq_ try: from nose.tools import assert_raises_regexp except ImportError: + from ansible.compat.six import string_types # Python < 2.7 def assert_raises_regexp(expected, regexp, callable, *a, **kw): try: callable(*a, **kw) except expected as e: - if isinstance(regexp, basestring): + if isinstance(regexp, string_types): regexp = re.compile(regexp) if not regexp.search(str(e)): raise Exception('"%s" does not match "%s"' % |