From 41455480beb5eec78303be3d4695ce34c40f8e4f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 21 Nov 2022 23:06:26 +0100 Subject: [PATCH] Better search for venvs --- jedi/api/project.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jedi/api/project.py b/jedi/api/project.py index c579c78b..8927e7ea 100644 --- a/jedi/api/project.py +++ b/jedi/api/project.py @@ -352,9 +352,8 @@ class Project: # 3. Search for modules on sys.path sys_path = [ p for p in self._get_sys_path(inference_state) - # Exclude folders that are handled by recursing of the Python - # folders. - if not p.startswith(str(self._path)) + # Exclude the current folder which is handled by recursing the folders. + if p != self._path ] names = list(iter_module_names(inference_state, empty_module_context, sys_path)) yield from search_in_module(