From c8ee35761341458ee58e11742c2db79f9988846e Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 26 Jul 2023 00:17:41 -0400 Subject: [PATCH] Remove relative import handling from `BindingKind::Import` case (#6084) ## Summary Only `ImportFrom` imports can be relative, this is just unused. --- crates/ruff_python_semantic/src/model.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/crates/ruff_python_semantic/src/model.rs b/crates/ruff_python_semantic/src/model.rs index 5171ff0b84..a4b50b25ed 100644 --- a/crates/ruff_python_semantic/src/model.rs +++ b/crates/ruff_python_semantic/src/model.rs @@ -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,