mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-11 14:18:28 +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 {
|
||||
qualified_name: name,
|
||||
}) => {
|
||||
if name.starts_with('.') {
|
||||
let mut source_path = from_relative_import(self.module_path?, name);
|
||||
if source_path.is_empty() {
|
||||
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)
|
||||
}
|
||||
let mut source_path: CallPath = from_unqualified_name(name);
|
||||
source_path.extend_from_slice(tail);
|
||||
Some(source_path)
|
||||
}
|
||||
BindingKind::SubmoduleImport(SubmoduleImport {
|
||||
qualified_name: name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue