diff options
| author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-12-27 14:41:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-27 14:41:51 +0100 |
| commit | 7b049a163cc704955a4260992302ff755f6a6789 (patch) | |
| tree | 5c22324fea8723d07c0814b261a4ec01d603f678 | |
| parent | 39c37c1fa944a577124f3482e3714f82f0c1b6dd (diff) | |
| download | astroid-git-7b049a163cc704955a4260992302ff755f6a6789.tar.gz | |
Revert "Remove useless NoReturn in NodeNG.statement's typing (#1304)" (#1307)
This reverts commit df854be56ee5019fb7f578ffd4da068e46ed112a.
| -rw-r--r-- | astroid/nodes/node_ng.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py index bb323b10..80f087c4 100644 --- a/astroid/nodes/node_ng.py +++ b/astroid/nodes/node_ng.py @@ -32,6 +32,11 @@ from astroid.nodes.const import OP_PRECEDENCE if TYPE_CHECKING: from astroid import nodes + if sys.version_info >= (3, 6, 2): + from typing import NoReturn + else: + from typing_extensions import NoReturn + if sys.version_info >= (3, 8): from typing import Literal else: @@ -282,7 +287,7 @@ class NodeNG: def statement( self, *, future: Literal[None, True] = None - ) -> Union["nodes.Statement", "nodes.Module"]: + ) -> Union["nodes.Statement", "nodes.Module", "NoReturn"]: """The first parent node, including self, marked as statement node. TODO: Deprecate the future parameter and only raise StatementMissing and return |
