diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-04-29 23:44:12 +0900 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-04-29 23:44:12 +0900 |
commit | 00eff0b7f656b5212b6f4d2c567f6828ee81ee82 (patch) | |
tree | c2c9028bcde9a51b75743a7b00d298da59e86e03 /tests/path.py | |
parent | 91b9d75ac88afc349de4f8629b99c7fbcb3ff841 (diff) | |
download | sphinx-git-00eff0b7f656b5212b6f4d2c567f6828ee81ee82.tar.gz |
use six privided text_type() to replace with unicode() to support py2/py3 in one source. refs #1350.
Diffstat (limited to 'tests/path.py')
-rwxr-xr-x | tests/path.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/path.py b/tests/path.py index 860e65e18..ddfd49b79 100755 --- a/tests/path.py +++ b/tests/path.py @@ -13,12 +13,13 @@ import shutil from codecs import open import six +from six import text_type FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding() -class path(unicode): +class path(text_type): """ Represents a path which behaves like a string. """ @@ -26,8 +27,8 @@ class path(unicode): def __new__(cls, s, encoding=FILESYSTEMENCODING, errors='strict'): if isinstance(s, str): s = s.decode(encoding, errors) - return unicode.__new__(cls, s) - return unicode.__new__(cls, s) + return text_type.__new__(cls, s) + return text_type.__new__(cls, s) @property def parent(self): @@ -195,4 +196,4 @@ class path(unicode): __div__ = __truediv__ = joinpath def __repr__(self): - return '%s(%s)' % (self.__class__.__name__, unicode.__repr__(self)) + return '%s(%s)' % (self.__class__.__name__, text_type.__repr__(self)) |