fix a bug

--HG--
branch : trunk
This commit is contained in:
holger krekel 2009-04-14 17:25:59 +02:00
parent de4c2dc98d
commit f0a277008a
2 changed files with 7 additions and 3 deletions

View File

@ -90,9 +90,7 @@ class Registry:
l = []
if plugins is None:
plugins = self._plugins
if extra:
plugins += list(extra)
for plugin in plugins:
for plugin in list(plugins) + list(extra):
try:
l.append(getattr(plugin, attrname))
except AttributeError:

View File

@ -135,6 +135,12 @@ class TestRegistry:
l = list(plugins.listattr('x', reverse=True))
assert l == [43, 42, 41]
class api4:
x = 44
l = list(plugins.listattr('x', extra=(api4,)))
assert l == range(41, 45)
assert len(list(plugins)) == 3 # otherwise extra added
def test_api_and_defaults():
assert isinstance(py._com.comregistry, Registry)