diff --git a/crates/ruff/resources/test/fixtures/pyflakes/F821_10.py b/crates/ruff/resources/test/fixtures/pyflakes/F821_10.py new file mode 100644 index 0000000000..1c43827057 --- /dev/null +++ b/crates/ruff/resources/test/fixtures/pyflakes/F821_10.py @@ -0,0 +1,4 @@ +try: + pass +except ExceptionGroup: + pass diff --git a/crates/ruff/src/rules/pyflakes/mod.rs b/crates/ruff/src/rules/pyflakes/mod.rs index be0b1cf7c1..6db17a0888 100644 --- a/crates/ruff/src/rules/pyflakes/mod.rs +++ b/crates/ruff/src/rules/pyflakes/mod.rs @@ -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")] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap new file mode 100644 index 0000000000..bd5537b631 --- /dev/null +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_10.py.snap @@ -0,0 +1,6 @@ +--- +source: crates/ruff/src/rules/pyflakes/mod.rs +expression: diagnostics +--- +[] + diff --git a/crates/ruff_python/src/builtins.rs b/crates/ruff_python/src/builtins.rs index 497e3fb281..fe376fd3f3 100644 --- a/crates/ruff_python/src/builtins.rs +++ b/crates/ruff_python/src/builtins.rs @@ -17,6 +17,7 @@ pub const BUILTINS: &[&str] = &[ "Ellipsis", "EnvironmentError", "Exception", + "ExceptionGroup", "False", "FileExistsError", "FileNotFoundError",