mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-13 02:00:13 +08:00
A property can raise an Exception, therefore the interpreter completion should check for those exceptions, fixes #538.
This commit is contained in:
1 parent
54d8cd0a9b
commit
4bb41b6096
2 files changed
+11
-1
No files matched your search
@@ -618,7 +618,7 @@ class Interpreter(Script):
|
|||||||
for n in old:
|
for n in old:
|
||||||
try:
|
try:
|
||||||
namespaces.append(getattr(n, p))
|
namespaces.append(getattr(n, p))
|
||||||
except AttributeError:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
completion_names = []
|
completion_names = []
|
||||||
|
|||||||
@@ -80,3 +80,13 @@ class TestInterpreterAPI(TestCase):
|
|||||||
|
|
||||||
foo = Foo()
|
foo = Foo()
|
||||||
self.check_interpreter_complete('foo[0].', locals(), [])
|
self.check_interpreter_complete('foo[0].', locals(), [])
|
||||||
|
|
||||||
|
def test_property_error(self):
|
||||||
|
class Foo():
|
||||||
|
@property
|
||||||
|
def bar(self):
|
||||||
|
raise ValueError
|
||||||
|
|
||||||
|
foo = Foo()
|
||||||
|
self.check_interpreter_complete('foo.bar', locals(), ['bar'])
|
||||||
|
self.check_interpreter_complete('foo.bar.baz', locals(), [])
|
||||||
Reference in new issue
Block a user