summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2010-07-05 08:10:40 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2010-07-05 08:10:40 +0200
commit97a1dcea92a20cbf9f80069f81e73fe043d08516 (patch)
treea71f0bddce012417008942ec8bfdb0a3e365e1f7
parentc85af9cce2a3115da3dfaa45d61e3be2d1f51ab4 (diff)
downloadastroid-git-97a1dcea92a20cbf9f80069f81e73fe043d08516.tar.gz
fix Class.interfaces so that no InferenceError raised on empty __implements__
--HG-- branch : stable
-rw-r--r--scoped_nodes.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scoped_nodes.py b/scoped_nodes.py
index d6595b28..b53ec4e5 100644
--- a/scoped_nodes.py
+++ b/scoped_nodes.py
@@ -927,13 +927,15 @@ class Class(StmtMixIn, LocalsDictNodeNG, FilterStmtsMixin):
if not herited and not implements.frame() is self:
return
found = set()
+ missing = False
for iface in unpack_infer(implements):
if iface is YES:
+ missing = True
continue
if not iface in found and handler_func(iface):
found.add(iface)
yield iface
- if not found:
+ if missing:
raise InferenceError()