diff --git a/py/_com.py b/py/_com.py index 138451752..3666cae8b 100644 --- a/py/_com.py +++ b/py/_com.py @@ -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: diff --git a/py/misc/testing/test_com.py b/py/misc/testing/test_com.py index 4b2bc9cdc..a289b5277 100644 --- a/py/misc/testing/test_com.py +++ b/py/misc/testing/test_com.py @@ -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)