mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-07 05:17:10 +03:00
Fixed recent regression in import resolver that caused a local import to no longer be preferred over an installed module by the same name.
This commit is contained in:
parent
cfc07ef20f
commit
be6c748007
@ -1371,6 +1371,11 @@ export class ImportResolver {
|
||||
return newImport;
|
||||
}
|
||||
|
||||
// Prefer local packages.
|
||||
if (bestImportSoFar.importType === ImportType.Local && !bestImportSoFar.isNamespacePackage) {
|
||||
return bestImportSoFar;
|
||||
}
|
||||
|
||||
// If both are namespace imports, select the one that resolves the symbols.
|
||||
if (
|
||||
bestImportSoFar.isNamespacePackage &&
|
||||
|
Loading…
Reference in New Issue
Block a user