Fix ExceptionGroup F821 false positive

This commit is contained in:
Jonathan Plasse 2023-02-23 09:58:36 +01:00
parent 4357f2be0f
commit b6445de34d
No known key found for this signature in database
GPG Key ID: 19B7C93E15074303
4 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,4 @@
try:
pass
except ExceptionGroup:
pass

View File

@ -102,6 +102,7 @@ mod tests {
#[test_case(Rule::UndefinedName, Path::new("F821_7.py"); "F821_7")]
#[test_case(Rule::UndefinedName, Path::new("F821_8.pyi"); "F821_8")]
#[test_case(Rule::UndefinedName, Path::new("F821_9.py"); "F821_9")]
#[test_case(Rule::UndefinedName, Path::new("F821_10.py"); "F821_10")]
#[test_case(Rule::UndefinedExport, Path::new("F822_0.py"); "F822_0")]
#[test_case(Rule::UndefinedExport, Path::new("F822_1.py"); "F822_1")]
#[test_case(Rule::UndefinedExport, Path::new("F822_2.py"); "F822_2")]

View File

@ -0,0 +1,6 @@
---
source: crates/ruff/src/rules/pyflakes/mod.rs
expression: diagnostics
---
[]

View File

@ -17,6 +17,7 @@ pub const BUILTINS: &[&str] = &[
"Ellipsis",
"EnvironmentError",
"Exception",
"ExceptionGroup",
"False",
"FileExistsError",
"FileNotFoundError",