From e7e1b2725b4cac182bfc584368815d688d34f953 Mon Sep 17 00:00:00 2001 From: hpk Date: Fri, 3 Apr 2009 12:59:34 +0200 Subject: [PATCH] [svn r63562] fixing _com regarding pyevents as well --HG-- branch : trunk --- py/_com.py | 9 ++++++--- py/misc/testing/test_com.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) 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])