mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix missing module: warnings
This commit is contained in:
parent
26ea870267
commit
62d94729ab
@ -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
|
||||||
|
|
||||||
|
@ -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]))
|
||||||
|
Loading…
Reference in New Issue
Block a user