Make sure py__bases__always return something

This commit is contained in:
Jean Cavallo
2019-06-13 09:37:51 +02:00
parent a3afdc0ece
commit ce97b0a5e7
2 changed files with 10 additions and 11 deletions

View File

@@ -233,8 +233,10 @@ class ClassContext(use_metaclass(CachedMetaClass, ClassMixin, FunctionAndClassBa
if arglist:
from jedi.evaluate import arguments
args = arguments.TreeArguments(self.evaluator, self.parent_context, arglist)
return [value for key, value in args.unpack() if key is None]
else:
lst = [value for key, value in args.unpack() if key is None]
if lst:
return lst
if self.py__name__() == 'object' \
and self.parent_context == self.evaluator.builtins_module:
return []

View File

@@ -243,9 +243,6 @@ def builtins_super(types, objects, context):
if isinstance(context, FunctionExecutionContext):
if isinstance(context.var_args, InstanceArguments):
su = context.var_args.instance.py__class__().py__bases__()
# If super class cannot be infered
if len(su) == 0:
return NO_CONTEXTS
return su[0].infer().execute_evaluated()
return NO_CONTEXTS