mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-04 09:42:47 +00:00
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
1 changed files with 3 additions and 13 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue