mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
fix problems with decorators with call signatures, fixes #319
This commit is contained in:
@@ -212,7 +212,8 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
|
|||||||
|
|
||||||
def get_decorated_func(self):
|
def get_decorated_func(self):
|
||||||
""" Needed because the InstanceElement should not be stripped """
|
""" Needed because the InstanceElement should not be stripped """
|
||||||
func = self.var.get_decorated_func(self.instance)
|
func = self.var.get_decorated_func()
|
||||||
|
func = InstanceElement(self._evaluator, self.instance, func)
|
||||||
if func == self.var:
|
if func == self.var:
|
||||||
return self
|
return self
|
||||||
return func
|
return func
|
||||||
|
|||||||
@@ -157,4 +157,4 @@ class TestCallSignatures(TestCase):
|
|||||||
signatures = Script(s).call_signatures()
|
signatures = Script(s).call_signatures()
|
||||||
assert len(signatures) == 1
|
assert len(signatures) == 1
|
||||||
x = [p.get_code() for p in signatures[0].params]
|
x = [p.get_code() for p in signatures[0].params]
|
||||||
assert x == ['*args']
|
assert x == ['*args\n']
|
||||||
|
|||||||
Reference in New Issue
Block a user