summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2023-04-05 03:42:08 -0400
committerGitHub <noreply@github.com>2023-04-05 09:42:08 +0200
commitb1e1e24c00eff00d3401d58ebd522d697d743b1c (patch)
tree171690d207bb52cba176848cb6cfb3d2cbf1d622 /astroid
parent92a51d0830a866450fbf75e45b840c8247bdb829 (diff)
downloadastroid-git-b1e1e24c00eff00d3401d58ebd522d697d743b1c.tar.gz
Mandatory fields for Raise (#2103)
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'astroid')
-rw-r--r--astroid/nodes/node_classes.py48
1 files changed, 6 insertions, 42 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index bb581af9..1a4613e4 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -2997,53 +2997,17 @@ class Raise(_base_nodes.Statement):
_astroid_fields = ("exc", "cause")
- def __init__(
- self,
- lineno: int | None = None,
- col_offset: int | None = None,
- parent: NodeNG | None = None,
- *,
- end_lineno: int | None = None,
- end_col_offset: int | None = None,
- ) -> None:
- """
- :param lineno: The line that this node appears on in the source code.
-
- :param col_offset: The column that this node appears on in the
- source code.
-
- :param parent: The parent node in the syntax tree.
-
- :param end_lineno: The last line this node appears on in the source code.
-
- :param end_col_offset: The end column this node appears on in the
- source code. Note: This is after the last symbol.
- """
- self.exc: NodeNG | None = None # can be None
- """What is being raised."""
+ exc: NodeNG | None
+ """What is being raised."""
- self.cause: NodeNG | None = None # can be None
- """The exception being used to raise this one."""
-
- super().__init__(
- lineno=lineno,
- col_offset=col_offset,
- end_lineno=end_lineno,
- end_col_offset=end_col_offset,
- parent=parent,
- )
+ cause: NodeNG | None
+ """The exception being used to raise this one."""
def postinit(
self,
- exc: NodeNG | None = None,
- cause: NodeNG | None = None,
+ exc: NodeNG | None,
+ cause: NodeNG | None,
) -> None:
- """Do some setup after initialisation.
-
- :param exc: What is being raised.
-
- :param cause: The exception being used to raise this one.
- """
self.exc = exc
self.cause = cause