Skip to content

Commit d211074

Browse files
Clarify unsafe case in RSE102 (#8256)
1 parent 4ffd4ed commit d211074

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ use crate::checkers::ast::Checker;
1919
/// ## Known problems
2020
/// Parentheses can only be omitted if the exception is a class, as opposed to
2121
/// a function call. This rule isn't always capable of distinguishing between
22-
/// the two. For example, if you define a method `get_exception` that itself
23-
/// returns an exception object, this rule will falsy mark the parentheses
24-
/// in `raise get_exception()` as unnecessary.
22+
/// the two.
23+
///
24+
/// For example, if you import a function `module.get_exception` from another
25+
/// module, and `module.get_exception` returns an exception object, this rule will
26+
/// incorrectly mark the parentheses in `raise module.get_exception()` as
27+
/// unnecessary.
2528
///
2629
/// ## Example
2730
/// ```python

0 commit comments

Comments
 (0)