From c2262d9fe4eaac507ff128ae60b6682e8d132e4d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 Jun 2018 10:20:34 -0400 Subject: Use text_type and string_types from six --- pkg_resources/tests/test_pkg_resources.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pkg_resources') diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py index 079e83f8..4e2cac94 100644 --- a/pkg_resources/tests/test_pkg_resources.py +++ b/pkg_resources/tests/test_pkg_resources.py @@ -13,16 +13,12 @@ import distutils.dist import distutils.command.install_egg_info from pkg_resources.extern.six.moves import map +from pkg_resources.extern.six import text_type, string_types import pytest import pkg_resources -try: - unicode -except NameError: - unicode = str - __metaclass__ = type @@ -37,7 +33,7 @@ def timestamp(dt): return time.mktime(dt.timetuple()) -class EggRemover(unicode): +class EggRemover(text_type): def __call__(self): if self in sys.path: sys.path.remove(self) @@ -140,7 +136,7 @@ class TestResourceManager: path = mgr.get_cache_path('foo') type_ = str(type(path)) message = "Unexpected type from get_cache_path: " + type_ - assert isinstance(path, (unicode, str)), message + assert isinstance(path, string_types), message class TestIndependence: -- cgit v1.2.3