summaryrefslogtreecommitdiff
path: root/lib/py/test/_import_local_thrift.py
diff options
context:
space:
mode:
authorJiayu Liu <Jimexist@users.noreply.github.com>2023-04-20 07:39:35 +0800
committerGitHub <noreply@github.com>2023-04-20 07:39:35 +0800
commit6f339004e6c636d9ce7b114d351e9141edff5c17 (patch)
tree9050ed69e347cfc1c335da0756bbbf3d96615a68 /lib/py/test/_import_local_thrift.py
parent1e3d90d8fd4160d538b7a4d902169eae5155e08a (diff)
downloadthrift-6f339004e6c636d9ce7b114d351e9141edff5c17.tar.gz
THRIFT-5564: add GitHub action for python 2.x and 3.x (#2787)
* update .github workflow to consolidate config * add lib python * Update build.yml update * rust => rs * Update build.yml update * update install openssl remove 3.6 setup daemon try 3.6 fix lib path add backports of py Update build.yml use sudo add install-exec-hook * add ssl test skip
Diffstat (limited to 'lib/py/test/_import_local_thrift.py')
-rw-r--r--lib/py/test/_import_local_thrift.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/py/test/_import_local_thrift.py b/lib/py/test/_import_local_thrift.py
index d22312298..37b751075 100644
--- a/lib/py/test/_import_local_thrift.py
+++ b/lib/py/test/_import_local_thrift.py
@@ -25,6 +25,8 @@ SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__))
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
for libpath in glob.glob(os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib.*')):
- if libpath.endswith('-%d.%d' % (sys.version_info[0], sys.version_info[1])):
- sys.path.insert(0, libpath)
- break
+ for pattern in ('-%d.%d', '-%d%d'):
+ postfix = pattern % (sys.version_info[0], sys.version_info[1])
+ if libpath.endswith(postfix):
+ sys.path.insert(0, libpath)
+ break