diff --git a/py/_com.py b/py/_com.py index 89b8356d3..f9803c854 100644 --- a/py/_com.py +++ b/py/_com.py @@ -51,7 +51,11 @@ class MultiCall: if needscall: res = currentmethod(self, *self.args, **self.kwargs) else: - res = currentmethod(*self.args, **self.kwargs) + #try: + res = currentmethod(*self.args, **self.kwargs) + #except TypeError: + # print currentmethod.__module__, currentmethod.__name__, self.args, self.kwargs + # raise if hasattr(self, '_ex1'): self.results = [res] break @@ -152,7 +156,6 @@ class PyPlugins: MultiCall(self.listattr("pyevent__" + eventname), *args, **kwargs).execute() #print "calling anonymous hooks", args, kwargs - MultiCall(self.listattr("pyevent"), - eventname, *args, **kwargs).execute() + MultiCall(self.listattr("pyevent"), eventname, args, kwargs).execute() pyplugins = PyPlugins() diff --git a/py/misc/testing/test_com.py b/py/misc/testing/test_com.py index d265a2738..4e54fe2cb 100644 --- a/py/misc/testing/test_com.py +++ b/py/misc/testing/test_com.py @@ -181,7 +181,7 @@ class TestPyPlugins: def pyevent__hello(self): l.append("hellospecific") class api2: - def pyevent(self, name, *args): + def pyevent(self, name, args, kwargs): if name == "hello": l.append(name + "anonymous") plugins.register(api1()) @@ -240,7 +240,7 @@ class TestPyPluginsEvents: plugins = PyPlugins() l = [] class A: - def pyevent(self, name, *args, **kwargs): + def pyevent(self, name, args, kwargs): if name == "name": l.extend([args, kwargs])