mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
Ignore super calls when super class cannot be inferred
This commit is contained in:
@@ -243,6 +243,9 @@ 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
|
||||
|
||||
@@ -276,3 +276,17 @@ qsplit = shlex.split("foo, ferwerwerw werw werw e")
|
||||
for part in qsplit:
|
||||
#? str()
|
||||
part
|
||||
|
||||
# -----------------
|
||||
# Unknown metaclass
|
||||
# -----------------
|
||||
|
||||
# Github issue 1321
|
||||
class Meta(object):
|
||||
pass
|
||||
|
||||
class Test(metaclass=Meta):
|
||||
def test_function(self):
|
||||
result = super(Test, self).test_function()
|
||||
#? []
|
||||
result.
|
||||
|
||||
Reference in New Issue
Block a user