---
source: crates/ruff_linter/src/rules/flake8_raise/mod.rs
---
RSE102 [*] Unnecessary parentheses on raised exception
 --> RSE102.py:5:21
  |
3 | except TypeError:
4 |     # RSE102
5 |     raise ValueError()
  |                     ^^
6 |
7 | try:
  |
help: Remove unnecessary parentheses
  |
4 |     # RSE102
  -     raise ValueError()
5 +     raise ValueError
6 |
  |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:13:16
   |
12 | # RSE102
13 | raise TypeError()
   |                ^^
14 |
15 | # RSE102
   |
help: Remove unnecessary parentheses
   |
12 | # RSE102
   - raise TypeError()
13 + raise TypeError
14 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:16:17
   |
15 | # RSE102
16 | raise TypeError ()
   |                 ^^
17 |
18 | # RSE102
   |
help: Remove unnecessary parentheses
   |
15 | # RSE102
   - raise TypeError ()
16 + raise TypeError 
17 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:20:5
   |
18 | # RSE102
19 | raise TypeError \
20 |     ()
   |     ^^
21 |
22 | # RSE102
   |
help: Remove unnecessary parentheses
   |
19 | raise TypeError \
   -     ()
20 +     
21 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:24:5
   |
22 | # RSE102
23 | raise TypeError \
24 |     ();
   |     ^^
25 |
26 | # RSE102
   |
help: Remove unnecessary parentheses
   |
23 | raise TypeError \
   -     ();
24 +     ;
25 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:27:16
   |
26 |   # RSE102
27 |   raise TypeError(
   |  ________________^
28 | |
29 | | )
   | |_^
30 |
31 |   # RSE102
   |
help: Remove unnecessary parentheses
   |
26 | # RSE102
   - raise TypeError(
   -
   - )
27 + raise TypeError
28 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:32:19
   |
31 |   # RSE102
32 |   raise (TypeError) (
   |  ___________________^
33 | |
34 | | )
   | |_^
35 |
36 |   # RSE102
   |
help: Remove unnecessary parentheses
   |
31 | # RSE102
   - raise (TypeError) (
   -
   - )
32 + raise (TypeError) 
33 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:37:16
   |
36 |   # RSE102
37 |   raise TypeError(
   |  ________________^
38 | |     # Hello, world!
39 | | )
   | |_^
40 |
41 |   # OK
   |
help: Remove unnecessary parentheses
   |
36 | # RSE102
   - raise TypeError(
   -     # Hello, world!
   - )
37 + raise TypeError
38 |
   |
note: This is an unsafe fix and may change runtime behavior

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:74:17
   |
73 | # RSE102
74 | raise IndexError()from ZeroDivisionError
   |                 ^^
75 |
76 | raise IndexError()\
   |
help: Remove unnecessary parentheses
   |
73 | # RSE102
   - raise IndexError()from ZeroDivisionError
74 + raise IndexError from ZeroDivisionError
75 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:76:17
   |
74 | raise IndexError()from ZeroDivisionError
75 |
76 | raise IndexError()\
   |                 ^^
77 | from ZeroDivisionError
   |
help: Remove unnecessary parentheses
   |
75 |
   - raise IndexError()\
76 + raise IndexError\
77 | from ZeroDivisionError
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:79:17
   |
77 | from ZeroDivisionError
78 |
79 | raise IndexError() from ZeroDivisionError
   |                 ^^
80 |
81 | raise IndexError();
   |
help: Remove unnecessary parentheses
   |
78 |
   - raise IndexError() from ZeroDivisionError
79 + raise IndexError from ZeroDivisionError
80 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:81:17
   |
79 | raise IndexError() from ZeroDivisionError
80 |
81 | raise IndexError();
   |                 ^^
82 |
83 | # RSE102
   |
help: Remove unnecessary parentheses
   |
80 |
   - raise IndexError();
81 + raise IndexError;
82 |
   |

RSE102 [*] Unnecessary parentheses on raised exception
  --> RSE102.py:84:10
   |
83 | # RSE102
84 | raise Foo()
   |          ^^
85 |
86 | # OK
   |
help: Remove unnecessary parentheses
   |
83 | # RSE102
   - raise Foo()
84 + raise Foo
85 |
   |
note: This is an unsafe fix and may change runtime behavior

RSE102 [*] Unnecessary parentheses on raised exception
   --> RSE102.py:107:27
    |
105 | future = executor.submit(float, "a")
106 | if future.exception():
107 |     raise future.Exception()
    |                           ^^
    |
help: Remove unnecessary parentheses
    |
106 | if future.exception():
    -     raise future.Exception()
107 +     raise future.Exception
108 |
    |
note: This is an unsafe fix and may change runtime behavior

RSE102 [*] Unnecessary parentheses on raised exception
   --> RSE102.py:110:16
    |
110 |   raise TypeError(
    |  ________________^
111 | |     # comment
112 | | )
    | |_^
    |
help: Remove unnecessary parentheses
    |
109 |
    - raise TypeError(
    -     # comment
    - )
110 + raise TypeError
    |
note: This is an unsafe fix and may change runtime behavior
