---
source: crates/ruff_linter/src/rules/flake8_return/mod.rs
---
RET506.py:8:5: RET506 Unnecessary `elif` after `raise` statement
   |
 6 |         a = 1
 7 |         raise Exception(y)
 8 |     elif z:
   |     ^^^^ RET506
 9 |         b = 2
10 |         raise Exception(w)
   |
   = help: Remove unnecessary `elif`

RET506.py:23:5: RET506 Unnecessary `elif` after `raise` statement
   |
21 |             b = 2
22 |         raise Exception(x)
23 |     elif z:
   |     ^^^^ RET506
24 |         raise Exception(y)
25 |     else:
   |
   = help: Remove unnecessary `elif`

RET506.py:34:5: RET506 Unnecessary `else` after `raise` statement
   |
32 |         a = 1
33 |         raise Exception(y)
34 |     else:
   |     ^^^^ RET506
35 |         b = 2
36 |         raise Exception(z)
   |
   = help: Remove unnecessary `else`

RET506.py:45:9: RET506 Unnecessary `else` after `raise` statement
   |
43 |             b = 2
44 |             raise Exception(y)
45 |         else:
   |         ^^^^ RET506
46 |             c = 3
47 |             raise Exception(x)
   |
   = help: Remove unnecessary `else`

RET506.py:60:5: RET506 Unnecessary `else` after `raise` statement
   |
58 |             b = 2
59 |         raise Exception(x)
60 |     else:
   |     ^^^^ RET506
61 |         c = 3
62 |     raise Exception(y)
   |
   = help: Remove unnecessary `else`

RET506.py:70:9: RET506 Unnecessary `else` after `raise` statement
   |
68 |             a = 4
69 |             raise Exception(x)
70 |         else:
   |         ^^^^ RET506
71 |             b = 2
72 |     else:
   |
   = help: Remove unnecessary `else`

RET506.py:80:5: RET506 Unnecessary `else` after `raise` statement
   |
78 |     if x:  # [no-else-raise]
79 |         raise Exception(True)
80 |     else:
   |     ^^^^ RET506
81 |         try:
82 |             raise Exception(False)
   |
   = help: Remove unnecessary `else`


