From e7a75c2a0d858ebc9d23c8c3181f5703fa02d484 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 26 May 2017 16:22:26 -0700 Subject: [PATCH] Properly proxy getattr within GatewayEvent (fixes #31) --- disco/gateway/events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/disco/gateway/events.py b/disco/gateway/events.py index f2da195..3822e13 100644 --- a/disco/gateway/events.py +++ b/disco/gateway/events.py @@ -64,8 +64,9 @@ class GatewayEvent(six.with_metaclass(GatewayEventMeta, Model)): return cls(obj, client) def __getattr__(self, name): - if hasattr(self, '_proxy'): - return getattr(getattr(self, self._proxy), name) + _proxy = object.__getattr__(self, '_proxy', None) + if _proxy: + return getattr(_proxy, name) return object.__getattribute__(self, name)