mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix an _sqlite3 issue temporarily
This commit is contained in:
@@ -7,8 +7,8 @@ from jedi.evaluate.cache import evaluator_function_cache
|
|||||||
from jedi.cache import memoize_method
|
from jedi.cache import memoize_method
|
||||||
from jedi.parser_utils import get_call_signature_for_any
|
from jedi.parser_utils import get_call_signature_for_any
|
||||||
from jedi.evaluate.base_context import ContextSet, iterator_to_context_set, \
|
from jedi.evaluate.base_context import ContextSet, iterator_to_context_set, \
|
||||||
ContextWrapper
|
ContextWrapper, NO_CONTEXTS
|
||||||
from jedi.evaluate.filters import AbstractTreeName, ParserTreeFilter, \
|
from jedi.evaluate.filters import ParserTreeFilter, \
|
||||||
NameWrapper, AbstractFilter, TreeNameDefinition
|
NameWrapper, AbstractFilter, TreeNameDefinition
|
||||||
from jedi.evaluate.context import ModuleContext, FunctionContext, \
|
from jedi.evaluate.context import ModuleContext, FunctionContext, \
|
||||||
ClassContext
|
ClassContext
|
||||||
@@ -120,6 +120,12 @@ class TypeshedPlugin(BasePlugin):
|
|||||||
|
|
||||||
def import_module(self, callback):
|
def import_module(self, callback):
|
||||||
def wrapper(evaluator, import_names, parent_module_context, sys_path):
|
def wrapper(evaluator, import_names, parent_module_context, sys_path):
|
||||||
|
if import_names == ('_sqlite3',):
|
||||||
|
# TODO Maybe find a better solution for this?
|
||||||
|
# The problem is IMO how star imports are priorized and that
|
||||||
|
# there's no clear ordering.
|
||||||
|
return NO_CONTEXTS
|
||||||
|
|
||||||
# This is a huge exception, we follow a nested import
|
# This is a huge exception, we follow a nested import
|
||||||
# ``os.path``, because it's a very important one in Python
|
# ``os.path``, because it's a very important one in Python
|
||||||
# that is being achieved by messing with ``sys.modules`` in
|
# that is being achieved by messing with ``sys.modules`` in
|
||||||
@@ -420,6 +426,7 @@ class StubOnlyModuleContext(_StubOnlyContext, ModuleContext):
|
|||||||
for f in filters:
|
for f in filters:
|
||||||
yield f
|
yield f
|
||||||
|
|
||||||
|
|
||||||
class StubOnlyClass(_StubOnlyContext, ContextWrapper):
|
class StubOnlyClass(_StubOnlyContext, ContextWrapper):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user