Make sure to stop gathering buildout paths at a certain point, fixes #1325

This commit is contained in:
Dave Halter
2020-01-22 23:31:27 +01:00
parent 6a75a0c590
commit 0c56aa4d4b

View File

@@ -10,6 +10,8 @@ from jedi.file_io import FileIO
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