diff options
Diffstat (limited to 'sphinx/testing/path.py')
-rw-r--r-- | sphinx/testing/path.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/testing/path.py b/sphinx/testing/path.py index 438a42d53..77df1ab9b 100644 --- a/sphinx/testing/path.py +++ b/sphinx/testing/path.py @@ -16,7 +16,6 @@ if False: # For type annotation import builtins # NOQA from typing import Any, Callable, IO, List # NOQA - from sphinx.util.typing import unicode # NOQA FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding() @@ -36,7 +35,7 @@ class path(text_type): return self.__class__(os.path.dirname(self)) def basename(self): - # type: () -> unicode + # type: () -> str return os.path.basename(self) def abspath(self): @@ -101,7 +100,7 @@ class path(text_type): shutil.rmtree(self, ignore_errors=ignore_errors, onerror=onerror) def copytree(self, destination, symlinks=False): - # type: (unicode, bool) -> None + # type: (str, bool) -> None """ Recursively copy a directory to the given `destination`. If the given `destination` does not exist it will be created. @@ -114,7 +113,7 @@ class path(text_type): shutil.copytree(self, destination, symlinks=symlinks) def movetree(self, destination): - # type: (unicode) -> None + # type: (str) -> None """ Recursively move the file or directory to the given `destination` similar to the Unix "mv" command. @@ -145,11 +144,11 @@ class path(text_type): os.utime(self, arg) def open(self, mode='r', **kwargs): - # type: (unicode, Any) -> IO + # type: (str, Any) -> IO return open(self, mode, **kwargs) def write_text(self, text, encoding='utf-8', **kwargs): - # type: (unicode, unicode, Any) -> None + # type: (str, str, Any) -> None """ Writes the given `text` to the file. """ @@ -159,7 +158,7 @@ class path(text_type): f.write(text) def text(self, encoding='utf-8', **kwargs): - # type: (unicode, Any) -> unicode + # type: (str, Any) -> str """ Returns the text in the file. """ @@ -219,7 +218,7 @@ class path(text_type): return self.__class__(os.path.join(self, *map(self.__class__, args))) def listdir(self): - # type: () -> List[unicode] + # type: () -> List[str] return os.listdir(self) __div__ = __truediv__ = joinpath |