Move py__getattribute__ to typeshed imports

This commit is contained in:
Dave Halter
2018-09-01 17:17:39 +02:00
parent ab4e415aec
commit ecda9cc746
2 changed files with 9 additions and 17 deletions

View File

@@ -122,12 +122,15 @@ class TypeshedPlugin(BasePlugin):
# ``os.path``, because it's a very important one in Python
# that is being achieved by messing with ``sys.modules`` in
# ``os``.
context_set = callback(
evaluator,
import_names,
parent_module_context,
sys_path
)
if import_names == ('os', 'path'):
context_set = parent_module_context.py__getattribute__('path')
else:
context_set = callback(
evaluator,
import_names,
parent_module_context,
sys_path
)
# Don't use CompiledObjects, they are just annoying and don't
# really help with anything. Just use the stub files instead.
context_set = ContextSet.from_iterable(