THRIFT-3613 Port Python C extension to Python 3
Client: Python
Patch: Nobuaki Sukegawa
This closes #845
diff --git a/test/py/TestClient.py b/test/py/TestClient.py
index e83a880..5de9fa3 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -26,9 +26,9 @@
import unittest
from optparse import OptionParser
+from util import local_libpath
+
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-ROOT_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-DEFAULT_LIBDIR_GLOB = os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib.*')
class AbstractTest(unittest.TestCase):
@@ -268,12 +268,12 @@
class AcceleratedBinaryTest(AbstractTest):
def get_protocol(self, transport):
- return TBinaryProtocol.TBinaryProtocolAcceleratedFactory().getProtocol(transport)
+ return TBinaryProtocol.TBinaryProtocolAcceleratedFactory(fallback=False).getProtocol(transport)
class AcceleratedCompactTest(AbstractTest):
def get_protocol(self, transport):
- return TCompactProtocol.TCompactProtocolAcceleratedFactory().getProtocol(transport)
+ return TCompactProtocol.TCompactProtocolAcceleratedFactory(fallback=False).getProtocol(transport)
def suite():
@@ -333,10 +333,7 @@
if options.genpydir:
sys.path.insert(0, os.path.join(SCRIPT_DIR, options.genpydir))
- if options.libpydir:
- sys.path.insert(0, glob.glob(options.libpydir)[0])
- else:
- sys.path.insert(0, glob.glob(DEFAULT_LIBDIR_GLOB)[0])
+ sys.path.insert(0, local_libpath())
from ThriftTest import ThriftTest
from ThriftTest.ttypes import Xtruct, Xtruct2, Numberz, Xception, Xception2