mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Move py__getattribute__ to typeshed imports
This commit is contained in:
@@ -74,17 +74,6 @@ class StdlibPlugin(BasePlugin):
|
|||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
def import_module(self, callback):
|
|
||||||
def wrapper(evaluator, import_names, parent_module_context, sys_path):
|
|
||||||
# This is a huge exception, we follow a nested import
|
|
||||||
# ``os.path``, because it's a very important one in Python
|
|
||||||
# that is being achieved by messing with ``sys.modules`` in
|
|
||||||
# ``os``.
|
|
||||||
if import_names == ('os', 'path'):
|
|
||||||
return parent_module_context.py__getattribute__('path')
|
|
||||||
return callback(evaluator, import_names, parent_module_context, sys_path)
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
|
|
||||||
def _follow_param(evaluator, arguments, index):
|
def _follow_param(evaluator, arguments, index):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ class TypeshedPlugin(BasePlugin):
|
|||||||
# ``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
|
||||||
# ``os``.
|
# ``os``.
|
||||||
|
if import_names == ('os', 'path'):
|
||||||
|
context_set = parent_module_context.py__getattribute__('path')
|
||||||
|
else:
|
||||||
context_set = callback(
|
context_set = callback(
|
||||||
evaluator,
|
evaluator,
|
||||||
import_names,
|
import_names,
|
||||||
|
|||||||
Reference in New Issue
Block a user