diff options
author | jfbu <jfbu@free.fr> | 2019-08-01 17:49:24 +0200 |
---|---|---|
committer | jfbu <jfbu@free.fr> | 2019-08-01 17:49:24 +0200 |
commit | 685e3fdb49c42b464e09ec955e1033e2a8729fff (patch) | |
tree | a7ad90fbd9c2a076575f612caf0d6baa7c4fb555 /sphinx/util/osutil.py | |
parent | eeca5ee91d2da817d4ad9e920ad7e4cabd966d08 (diff) | |
parent | 5a86a71a8fe6d4e8c3861f755cc9b05b5b10f0cf (diff) | |
download | sphinx-git-685e3fdb49c42b464e09ec955e1033e2a8729fff.tar.gz |
Merge branch '2.0'
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r-- | sphinx/util/osutil.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 08c7349dd..c5175bbf1 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -18,11 +18,15 @@ import sys import warnings from io import StringIO from os import path -from typing import Any, Generator, Iterator, List, Tuple, Type +from typing import Any, Generator, Iterator, List, Tuple from sphinx.deprecation import RemovedInSphinx40Warning from sphinx.testing.path import path as Path +if False: + # For type annotation + from typing import Type # for python3.5.1 + # Errnos that we need. EEXIST = getattr(errno, 'EEXIST', 0) # RemovedInSphinx40Warning ENOENT = getattr(errno, 'ENOENT', 0) # RemovedInSphinx40Warning @@ -226,7 +230,7 @@ class FileAvoidWrite: def __enter__(self) -> "FileAvoidWrite": return self - def __exit__(self, exc_type: Type[Exception], exc_value: Exception, traceback: Any) -> bool: # NOQA + def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> bool: # NOQA self.close() return True |