Skip to content

Commit 7b049a1

Browse files
authored
Revert "Remove useless NoReturn in NodeNG.statement's typing (#1304)" (#1307)
This reverts commit df854be.
1 parent 39c37c1 commit 7b049a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

astroid/nodes/node_ng.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
if TYPE_CHECKING:
3333
from astroid import nodes
3434

35+
if sys.version_info >= (3, 6, 2):
36+
from typing import NoReturn
37+
else:
38+
from typing_extensions import NoReturn
39+
3540
if sys.version_info >= (3, 8):
3641
from typing import Literal
3742
else:
@@ -282,7 +287,7 @@ def statement(self, *, future: Literal[True]) -> "nodes.Statement":
282287

283288
def statement(
284289
self, *, future: Literal[None, True] = None
285-
) -> Union["nodes.Statement", "nodes.Module"]:
290+
) -> Union["nodes.Statement", "nodes.Module", "NoReturn"]:
286291
"""The first parent node, including self, marked as statement node.
287292
288293
TODO: Deprecate the future parameter and only raise StatementMissing and return

0 commit comments

Comments
 (0)