1
0
forked from VimPlug/jedi

Fix issues with interpreter completions on unittest.mock.

For 3.6+ an error was ignored that lead to crashes. In 3.5 the OOM killer
eventually arrived...

Fixes #1415
This commit is contained in:
Dave Halter
2019-12-05 10:09:16 +01:00
parent cf65ecdb96
commit 54f4bd0bad
3 changed files with 50 additions and 3 deletions
+6 -1
View File
@@ -8,6 +8,7 @@ import sys
from jedi.parser_utils import get_cached_code_lines
from jedi._compatibility import unwrap
from jedi import settings
from jedi.inference import compiled
from jedi.cache import underscore_memoization
@@ -160,7 +161,11 @@ def _load_module(inference_state, path):
def _get_object_to_check(python_object):
"""Check if inspect.getfile has a chance to find the source."""
if sys.version_info[0] > 2:
python_object = inspect.unwrap(python_object)
try:
python_object = unwrap(python_object)
except ValueError:
# Can return a ValueError when it wraps around
pass
if (inspect.ismodule(python_object) or
inspect.isclass(python_object) or