thrift/test/features/local_thrift/__init__.py
2016-01-05 03:02:35 +09:00

15 lines
448 B
Python

import os
import sys
SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__))
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
if sys.version_info[0] == 2:
import glob
libdir = glob.glob(os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib.*'))[0]
sys.path.insert(0, libdir)
thrift = __import__('thrift')
else:
sys.path.insert(0, os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib'))
thrift = __import__('thrift')