diff --git a/python/helpers/profiler/thrift/TMultiplexedProcessor.py b/python/helpers/profiler/thrift/TMultiplexedProcessor.py index a8d5565c3629..71d838aeaf61 100644 --- a/python/helpers/profiler/thrift/TMultiplexedProcessor.py +++ b/python/helpers/profiler/thrift/TMultiplexedProcessor.py @@ -17,9 +17,13 @@ # under the License. # +from __future__ import absolute_import + from thrift.Thrift import TProcessor, TMessageType, TException + from thrift.protocol import TProtocolDecorator, TMultiplexedProtocol + class TMultiplexedProcessor(TProcessor): def __init__(self): self.services = {} diff --git a/python/helpers/profiler/thrift/TSerialization.py b/python/helpers/profiler/thrift/TSerialization.py index b8e52e5eadd2..70cc1a5cdf00 100644 --- a/python/helpers/profiler/thrift/TSerialization.py +++ b/python/helpers/profiler/thrift/TSerialization.py @@ -17,9 +17,12 @@ # under the License. # -from thrift.protocol import TBinaryProtocol +from __future__ import absolute_import + from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol + def serialize(thrift_object, protocol_factory=TBinaryProtocol.TBinaryProtocolFactory()): diff --git a/python/helpers/profiler/thrift/protocol/TBase.py b/python/helpers/profiler/thrift/protocol/TBase.py index 6cbd5f39a477..cadd9d6350df 100644 --- a/python/helpers/profiler/thrift/protocol/TBase.py +++ b/python/helpers/profiler/thrift/protocol/TBase.py @@ -16,11 +16,13 @@ # specific language governing permissions and limitations # under the License. # +from __future__ import absolute_import from thrift.Thrift import * -from thrift.protocol import TBinaryProtocol from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol + try: from thrift.protocol import fastbinary except: diff --git a/python/helpers/profiler/thrift/protocol/TMultiplexedProtocol.py b/python/helpers/profiler/thrift/protocol/TMultiplexedProtocol.py index d25f367b55e5..8ec9c579d85e 100644 --- a/python/helpers/profiler/thrift/protocol/TMultiplexedProtocol.py +++ b/python/helpers/profiler/thrift/protocol/TMultiplexedProtocol.py @@ -16,8 +16,10 @@ # specific language governing permissions and limitations # under the License. # +from __future__ import absolute_import from thrift.Thrift import TMessageType + from thrift.protocol import TProtocolDecorator SEPARATOR = ":" diff --git a/python/helpers/profiler/thrift/protocol/TProtocol.py b/python/helpers/profiler/thrift/protocol/TProtocol.py index 311a635fad8d..4ca064ab2122 100644 --- a/python/helpers/profiler/thrift/protocol/TProtocol.py +++ b/python/helpers/profiler/thrift/protocol/TProtocol.py @@ -17,6 +17,8 @@ # under the License. # +from __future__ import absolute_import + from thrift.Thrift import * diff --git a/python/helpers/profiler/thrift/protocol/TProtocolDecorator.py b/python/helpers/profiler/thrift/protocol/TProtocolDecorator.py index 3e9e5004e952..8c990fc9a68e 100644 --- a/python/helpers/profiler/thrift/protocol/TProtocolDecorator.py +++ b/python/helpers/profiler/thrift/protocol/TProtocolDecorator.py @@ -16,10 +16,12 @@ # specific language governing permissions and limitations # under the License. # +from __future__ import absolute_import from thrift.protocol.TProtocol import TProtocolBase from types import * + class TProtocolDecorator(): def __init__(self, protocol): TProtocolBase(protocol) diff --git a/python/helpers/profiler/thrift/transport/TSSLSocket.py b/python/helpers/profiler/thrift/transport/TSSLSocket.py index 81e0984261a1..a75c1ef3da2c 100644 --- a/python/helpers/profiler/thrift/transport/TSSLSocket.py +++ b/python/helpers/profiler/thrift/transport/TSSLSocket.py @@ -17,10 +17,11 @@ # under the License. # +from __future__ import absolute_import + import os import socket import ssl - from thrift.transport import TSocket from thrift.transport.TTransport import TTransportException diff --git a/python/helpers/profiler/thrift/transport/TTransport.py b/python/helpers/profiler/thrift/transport/TTransport.py index 5ab2fdefc720..f005f50e1672 100644 --- a/python/helpers/profiler/thrift/transport/TTransport.py +++ b/python/helpers/profiler/thrift/transport/TTransport.py @@ -17,6 +17,8 @@ # under the License. # +from __future__ import absolute_import + from cStringIO import StringIO from struct import pack, unpack from thrift.Thrift import TException diff --git a/python/helpers/profiler/thrift/transport/TTwisted.py b/python/helpers/profiler/thrift/transport/TTwisted.py index 29bbd4c71c59..fdff8ee0be83 100644 --- a/python/helpers/profiler/thrift/transport/TTwisted.py +++ b/python/helpers/profiler/thrift/transport/TTwisted.py @@ -16,19 +16,18 @@ # specific language governing permissions and limitations # under the License. # +from __future__ import absolute_import import struct from cStringIO import StringIO - -from zope.interface import implements, Interface, Attribute +from thrift.transport import TTransport +from twisted.internet import defer from twisted.internet.protocol import ServerFactory, ClientFactory, \ connectionDone -from twisted.internet import defer from twisted.internet.threads import deferToThread from twisted.protocols import basic from twisted.web import server, resource, http - -from thrift.transport import TTransport +from zope.interface import implements, Interface, Attribute class TMessageSenderTransport(TTransport.TTransportBase):