diff --git a/jedi/inference/sys_path.py b/jedi/inference/sys_path.py index a45999f12..5234ac2cd 100644 --- a/jedi/inference/sys_path.py +++ b/jedi/inference/sys_path.py @@ -10,6 +10,8 @@ from jedi import settings from jedi import debug +_BUILDOUT_PATH_INSERTION_LIMIT = 10 + def _abs_path(module_context, path): if os.path.isabs(path): @@ -138,6 +140,8 @@ def discover_buildout_paths(inference_state, script_path): for buildout_script_path in _get_buildout_script_paths(script_path): for path in _get_paths_from_buildout_script(inference_state, buildout_script_path): buildout_script_paths.add(path) + if len(buildout_script_paths) >= _BUILDOUT_PATH_INSERTION_LIMIT: + break return buildout_script_paths