Skip to content

Commit eedf0c8

Browse files
rchen152meta-codesync[bot]
authored andcommitted
Don't log missing-module-attribute when module lookup errors with NoStubs or NoSource
Summary: If we fail to resolve `from x import y` due to `y` not being found, we should report `missing-module-attribute`. If `y` was found but we want to emit some other warning about missing source or stubs for it, we should not report `missing-module-attribute`. Reviewed By: samwgoldman Differential Revision: D85578780 fbshipit-source-id: 4f93e62c08c455491951affee4f7cb6681394016
1 parent 975ef99 commit eedf0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrefly/lib/binding/stmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ impl<'a> BindingsBuilder<'a> {
10251025
FindingOrError::Finding(finding) => (true, finding.error),
10261026
FindingOrError::Error(error) => (false, Some(error)),
10271027
};
1028-
let error = error.is_some_and(|e| e.kind().is_some());
1028+
let error = error.is_some_and(|e| matches!(e, FindError::NotFound(..)));
10291029
if error {
10301030
self.error(
10311031
x.range,

0 commit comments

Comments
 (0)