py.twisted: Avoid synchronous exceptions
This is an update of the patch posted to:
https://issues.apache.org/jira/browse/THRIFT-585
and a re-write of 8345772
Patch: Mattias de Zalenski, James Broadhead
Jira: THRIFT-585
diff --git a/lib/py/src/transport/TTwisted.py b/lib/py/src/transport/TTwisted.py
index 2b77414..29bbd4c 100644
--- a/lib/py/src/transport/TTwisted.py
+++ b/lib/py/src/transport/TTwisted.py
@@ -42,7 +42,7 @@
def flush(self):
msg = self.__wbuf.getvalue()
self.__wbuf = StringIO()
- self.sendMessage(msg)
+ return self.sendMessage(msg)
def sendMessage(self, message):
raise NotImplementedError
@@ -55,7 +55,7 @@
self.func = func
def sendMessage(self, message):
- self.func(message)
+ return self.func(message)
class ThriftClientProtocol(basic.Int32StringReceiver):