mirror of https://github.com/astral-sh/ruff
Remove relative import handling from `BindingKind::Import` case (#6084)
## Summary Only `ImportFrom` imports can be relative, this is just unused.
This commit is contained in:
parent
96d2ca0bda
commit
c8ee357613
|
|
@ -578,19 +578,9 @@ impl<'a> SemanticModel<'a> {
|
||||||
BindingKind::Import(Import {
|
BindingKind::Import(Import {
|
||||||
qualified_name: name,
|
qualified_name: name,
|
||||||
}) => {
|
}) => {
|
||||||
if name.starts_with('.') {
|
let mut source_path: CallPath = from_unqualified_name(name);
|
||||||
let mut source_path = from_relative_import(self.module_path?, name);
|
source_path.extend_from_slice(tail);
|
||||||
if source_path.is_empty() {
|
Some(source_path)
|
||||||
None
|
|
||||||
} else {
|
|
||||||
source_path.extend_from_slice(tail);
|
|
||||||
Some(source_path)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let mut source_path: CallPath = from_unqualified_name(name);
|
|
||||||
source_path.extend_from_slice(tail);
|
|
||||||
Some(source_path)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
BindingKind::SubmoduleImport(SubmoduleImport {
|
BindingKind::SubmoduleImport(SubmoduleImport {
|
||||||
qualified_name: name,
|
qualified_name: name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue