Skip to content

Commit ef2a416

Browse files
Correct references to removed TryExcept node
Follow-up to e91a3b5.
1 parent cdeb259 commit ef2a416

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

ChangeLog

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ Release date: TBA
121121
- ``nodes.Slice``
122122
- ``nodes.Starred``
123123
- ``objects.Super``, we also added the ``call`` parameter to its ``__init__`` method.
124-
- ``nodes.TryExcept``
125124
- ``nodes.Subscript``
126125
- ``nodes.UnaryOp``
127126
- ``nodes.While``

astroid/nodes/node_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def are_exclusive(stmt1, stmt2, exceptions: list[str] | None = None) -> bool:
128128
algorithm :
129129
1) index stmt1's parents
130130
2) climb among stmt2's parents until we find a common parent
131-
3) if the common parent is a If or TryExcept statement, look if nodes are
131+
3) if the common parent is a If or Try statement, look if nodes are
132132
in exclusive branches
133133
"""
134134
# index stmt1's parents
@@ -2542,7 +2542,7 @@ class ExceptHandler(
25422542
print("Error!")
25432543
''')
25442544
>>> node
2545-
<TryExcept l.2 at 0x7f23b2e9d908>
2545+
<Try l.2 at 0x7f23b2e9d908>
25462546
>>> node.handlers
25472547
[<ExceptHandler l.4 at 0x7f23b2e9e860>]
25482548
"""

doc/api/astroid.nodes.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ Nodes
7676
astroid.nodes.Slice
7777
astroid.nodes.Starred
7878
astroid.nodes.Subscript
79-
astroid.nodes.TryExcept
80-
astroid.nodes.TryFinally
79+
astroid.nodes.Try
8180
astroid.nodes.TryStar
8281
astroid.nodes.Tuple
8382
astroid.nodes.TypeAlias
@@ -224,9 +223,7 @@ Nodes
224223

225224
.. autoclass:: astroid.nodes.Subscript
226225

227-
.. autoclass:: astroid.nodes.TryExcept
228-
229-
.. autoclass:: astroid.nodes.TryFinally
226+
.. autoclass:: astroid.nodes.Try
230227

231228
.. autoclass:: astroid.nodes.TryStar
232229

tests/test_inference.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6025,8 +6025,7 @@ def test_exception_lookup_last_except_handler_wins() -> None:
60256025
assert isinstance(inferred_exc, Instance)
60266026
assert inferred_exc.name == "OSError"
60276027

6028-
# Check that two except handlers on the same TryExcept works the same as separate
6029-
# TryExcepts
6028+
# Two except handlers on the same Try work the same as separate
60306029
node = extract_node(
60316030
"""
60326031
try:

tests/test_nodes_lineno.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def test_end_lineno_dict() -> None:
737737

738738
@staticmethod
739739
def test_end_lineno_try() -> None:
740-
"""TryExcept, TryFinally, ExceptHandler."""
740+
"""Try, ExceptHandler."""
741741
code = textwrap.dedent(
742742
"""
743743
try: #@

0 commit comments

Comments
 (0)