From 4ed6bd8a333be6504feed11f6268b303bfdf279a Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Thu, 15 Sep 2011 17:16:56 +0200 Subject: [PATCH] Added __nonzero__ method on RpcConnection class. --- sjrpc/core/rpcconnection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sjrpc/core/rpcconnection.py b/sjrpc/core/rpcconnection.py index 9755940..486af56 100644 --- a/sjrpc/core/rpcconnection.py +++ b/sjrpc/core/rpcconnection.py @@ -100,6 +100,9 @@ class RpcConnection(object): def __hash__(self): return self._sock.__hash__() + def __nonzero__(self): + return self._connected + def run(self): ''' Inbound message processing loop. -- GitLab