diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-24 18:21:03 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-24 18:21:03 +0200 |
commit | a88f317bbfe0cc725aa32a5329dc7b45532c11b4 (patch) | |
tree | 956fc1fca302343d1aa75f3b248e4d031d2e10f7 | |
parent | 2fc2a8897005765851a325f0e96dca65fa4a6557 (diff) | |
download | slixmpp-a88f317bbfe0cc725aa32a5329dc7b45532c11b4.tar.gz slixmpp-a88f317bbfe0cc725aa32a5329dc7b45532c11b4.tar.bz2 slixmpp-a88f317bbfe0cc725aa32a5329dc7b45532c11b4.tar.xz slixmpp-a88f317bbfe0cc725aa32a5329dc7b45532c11b4.zip |
XEP-0009: Fix invalid function name under Python 3.7.
-rw-r--r-- | slixmpp/plugins/xep_0009/remote.py | 7 |
1 files 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. |