diff options
| author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-12-13 22:56:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-13 22:56:19 +0100 |
| commit | e840a7c54d3d8b5be2db1e66f34a5368c64fc3f7 (patch) | |
| tree | 1ca9e87badd9614c4573cae5759d7bc1341af999 | |
| parent | c28bf74283500287e04fb9f5fcc739edc72cd7cd (diff) | |
| download | astroid-git-e840a7c54d3d8b5be2db1e66f34a5368c64fc3f7.tar.gz | |
Remove unused code - TreeRebuilder docstring (#1289)
| -rw-r--r-- | astroid/rebuilder.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index 1482eece..d3109748 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -48,7 +48,7 @@ from typing import ( from astroid import nodes from astroid._ast import ParserModule, get_parser_module, parse_function_type_comment -from astroid.const import PY37_PLUS, PY38, PY38_PLUS, Context +from astroid.const import PY38, PY38_PLUS, Context from astroid.manager import AstroidManager from astroid.nodes import NodeNG @@ -106,11 +106,7 @@ class TreeRebuilder: def _get_doc(self, node: T_Doc) -> Tuple[T_Doc, Optional[str]]: try: - if PY37_PLUS and hasattr(node, "docstring"): - doc = node.docstring # type: ignore[union-attr,attr-defined] # mypy doesn't recognize hasattr - return node, doc if node.body and isinstance(node.body[0], self._module.Expr): - first_value = node.body[0].value if isinstance(first_value, self._module.Str) or ( PY38_PLUS |
