diff --git a/jedi/inference/compiled/access.py b/jedi/inference/compiled/access.py index 299e3f03..42fe7ebe 100644 --- a/jedi/inference/compiled/access.py +++ b/jedi/inference/compiled/access.py @@ -1,5 +1,6 @@ import inspect import types +import traceback import sys import operator as op from collections import namedtuple @@ -117,13 +118,18 @@ def load_module(inference_state, dotted_name, sys_path): __import__(dotted_name) except ImportError: # If a module is "corrupt" or not really a Python module or whatever. - warnings.warn('Module %s not importable in path %s.' % (dotted_name, sys_path), UserWarning) + warnings.warn( + "Module %s not importable in path %s." % (dotted_name, sys_path), + UserWarning, + stacklevel=2, + ) return None except Exception: # Since __import__ pretty much makes code execution possible, just # catch any error here and print it. - import traceback - warnings.warn("Cannot import:\n%s" % traceback.format_exc(), UserWarning) + warnings.warn( + "Cannot import:\n%s" % traceback.format_exc(), UserWarning, stacklevel=2 + ) return None finally: sys.path = temp diff --git a/jedi/third_party/django-stubs b/jedi/third_party/django-stubs index fd057010..92c8dfc9 160000 --- a/jedi/third_party/django-stubs +++ b/jedi/third_party/django-stubs @@ -1 +1 @@ -Subproject commit fd057010f6cbf176f57d1099e82be46d39b99cb9 +Subproject commit 92c8dfc93f840b936e33eb3f1770293627ac0f15