Fix missing module: warnings

This commit is contained in:
Takeshi KOMIYA 2020-10-03 14:10:21 +09:00
parent 26ea870267
commit 62d94729ab
2 changed files with 1 additions and 6 deletions

View File

@ -9,6 +9,7 @@
""" """
import os import os
import warnings
from os import path from os import path
from typing import Any, Dict, Iterable, List, Tuple, Union from typing import Any, Dict, Iterable, List, Tuple, Union

View File

@ -1616,9 +1616,6 @@ class DataDocumenter(ModuleLevelDocumenter):
except KeyError: except KeyError:
# a broken class found (refs: https://github.com/sphinx-doc/sphinx/issues/8084) # a broken class found (refs: https://github.com/sphinx-doc/sphinx/issues/8084)
annotations = {} annotations = {}
except AttributeError:
# AttributeError is raised on 3.5.2 (fixed by 3.5.3)
annotations = {}
if self.objpath[-1] in annotations: if self.objpath[-1] in annotations:
objrepr = stringify_typehint(annotations.get(self.objpath[-1])) objrepr = stringify_typehint(annotations.get(self.objpath[-1]))
@ -1995,9 +1992,6 @@ class AttributeDocumenter(DocstringStripSignatureMixin, ClassLevelDocumenter):
except KeyError: except KeyError:
# a broken class found (refs: https://github.com/sphinx-doc/sphinx/issues/8084) # a broken class found (refs: https://github.com/sphinx-doc/sphinx/issues/8084)
annotations = {} annotations = {}
except AttributeError:
# AttributeError is raised on 3.5.2 (fixed by 3.5.3)
annotations = {}
if self.objpath[-1] in annotations: if self.objpath[-1] in annotations:
objrepr = stringify_typehint(annotations.get(self.objpath[-1])) objrepr = stringify_typehint(annotations.get(self.objpath[-1]))