diff --git a/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts b/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts index 7fe3e5361809..92b9471dd7d6 100644 --- a/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts +++ b/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts @@ -56,7 +56,7 @@ export class ParentDirectoryCache { this._libPathCache ?? this._importRootGetter() .map((r) => fs.realCasePath(r)) - .filter((r) => r !== root) + .filter((r) => !r.equals(root)) .filter((r) => r.startsWith(root)); if (this._libPathCache.some((p) => sourceFileUri.startsWith(p))) {