mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
378b727f8e
This closes #767
15 lines
448 B
Python
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')
|