THRIFT-4548: python binary accelerated protocol with multiplexing via decoration (#1547)
* Fix binary accelerated protocol with multiplexing
TMultiplexedProtocol objects did not inherit from TProtocol, so the
decorated protocol object passed into the binary accelerated C extension
was not really a TProtocol object, which caused errors. This
implementation decorates the protocol object by dynamically creating a
new class that extends both the class of the protocol being decorated
and TMultiplexedProtocol.
* THRIFT-4548: remove known failures for py multiplexed client cross tests
* Call super with args for python2 & pep8 fixes
* THRIFT-3877: disable known failures for http cpp tests
This closes #1535
diff --git a/lib/py/src/protocol/TMultiplexedProtocol.py b/lib/py/src/protocol/TMultiplexedProtocol.py
index 309f896..0f8390f 100644
--- a/lib/py/src/protocol/TMultiplexedProtocol.py
+++ b/lib/py/src/protocol/TMultiplexedProtocol.py
@@ -25,16 +25,15 @@
class TMultiplexedProtocol(TProtocolDecorator.TProtocolDecorator):
def __init__(self, protocol, serviceName):
- TProtocolDecorator.TProtocolDecorator.__init__(self, protocol)
self.serviceName = serviceName
def writeMessageBegin(self, name, type, seqid):
if (type == TMessageType.CALL or
type == TMessageType.ONEWAY):
- self.protocol.writeMessageBegin(
+ super(TMultiplexedProtocol, self).writeMessageBegin(
self.serviceName + SEPARATOR + name,
type,
seqid
)
else:
- self.protocol.writeMessageBegin(name, type, seqid)
+ super(TMultiplexedProtocol, self).writeMessageBegin(name, type, seqid)