Skip to content

Commit 5593599

Browse files
committed
refactor: one unbound is as good as another
1 parent fb4f142 commit 5593599

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8344,12 +8344,9 @@ impl<'db> ModuleLiteralType<'db> {
83448344
.map(|file| imported_symbol(db, file, name, None))
83458345
.unwrap_or_default();
83468346

8347-
// If the normal lookup failed, try to call the module's __getattr__ function
8347+
// If the normal lookup failed, try to call the module's `__getattr__` function
83488348
if result.place.is_unbound() {
8349-
let getattr_result = self.try_module_getattr(db, name);
8350-
if !getattr_result.place.is_unbound() {
8351-
return getattr_result;
8352-
}
8349+
return self.try_module_getattr(db, name);
83538350
}
83548351

83558352
result

0 commit comments

Comments
 (0)