From 0c56aa4d4be211b2fd691dcd68fc1b06de2c6c52 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 22 Jan 2020 23:31:27 +0100 Subject: [PATCH] Make sure to stop gathering buildout paths at a certain point, fixes #1325 --- jedi/inference/sys_path.py | 4 ++++ 1 file changed, 4 insertions(+) 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