Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Jan 2, 2025
1 parent 7746e45 commit d279d7c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub(crate) fn unresolved_references(checker: &mut Checker) {
}
} else {
if checker.enabled(Rule::UndefinedName) {
if checker.semantic.in_no_type_check() {
continue;
}

// Avoid flagging if `NameError` is handled.
if reference.exceptions().contains(Exceptions::NAME_ERROR) {
continue;
Expand All @@ -38,7 +42,7 @@ pub(crate) fn unresolved_references(checker: &mut Checker) {

let symbol_name = reference.name(checker.source());

checker.push_type_diagnostic(Diagnostic::new(
checker.diagnostics.push(Diagnostic::new(
pyflakes::rules::UndefinedName {
name: symbol_name.to_string(),
minor_version_builtin_added: version_builtin_was_added(symbol_name),
Expand Down

0 comments on commit d279d7c

Please sign in to comment.