forked from VimPlug/jedi
Make sure docstrings can always be inferred for builtins modules, fixes #1432
This commit is contained in:
@@ -45,7 +45,16 @@ def _limit_value_infers(func):
|
||||
inference_state = context.inference_state
|
||||
try:
|
||||
inference_state.inferred_element_counts[n] += 1
|
||||
if inference_state.inferred_element_counts[n] > 300:
|
||||
maximum = 300
|
||||
if context.parent_context is None \
|
||||
and context.get_value() is inference_state.builtins_module:
|
||||
# Builtins should have a more generous inference limit.
|
||||
# It is important that builtins can be executed, otherwise some
|
||||
# functions that depend on certain builtins features would be
|
||||
# broken, see e.g. GH #1432
|
||||
maximum *= 100
|
||||
|
||||
if inference_state.inferred_element_counts[n] > maximum:
|
||||
debug.warning('In value %s there were too many inferences.', n)
|
||||
return NO_VALUES
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user