summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py8
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