From a88f317bbfe0cc725aa32a5329dc7b45532c11b4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 24 Jul 2018 18:21:03 +0200 Subject: =?UTF-8?q?XEP-0009:=20Fix=20invalid=20function=20name=20under=20P?= =?UTF-8?q?ython=C2=A03.7.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slixmpp/plugins/xep_0009/remote.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/slixmpp/plugins/xep_0009/remote.py b/slixmpp/plugins/xep_0009/remote.py index 6fa85cc7..f3e64fb3 100644 --- a/slixmpp/plugins/xep_0009/remote.py +++ b/slixmpp/plugins/xep_0009/remote.py @@ -405,8 +405,10 @@ class Proxy(Endpoint): self._callback = callback def __getattribute__(self, name, *args): - if name in ('__dict__', '_endpoint', 'async', '_callback'): + if name in ('__dict__', '_endpoint', '_callback'): return object.__getattribute__(self, name) + elif name == 'async': + return lambda callback: Proxy(self._endpoint, callback) else: attribute = self._endpoint.__getattribute__(name) if hasattr(attribute, '__call__'): @@ -420,9 +422,6 @@ class Proxy(Endpoint): pass # If the attribute doesn't exist, don't care! return attribute - def async(self, callback): - return Proxy(self._endpoint, callback) - def get_endpoint(self): ''' Returns the proxified endpoint. -- cgit v1.2.3