File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -107,16 +107,13 @@ def __init__(self):
107107 self .lib = ctypes .CDLL (os .path .join (env_path , lib_full_name ()))
108108 elif env_install_path :
109109 install_kclvm (env_install_path )
110- self .lib = ctypes .CDLL (os .path .join (env_install_path , lib_full_name ()))
110+ self .lib = ctypes .CDLL (
111+ os .path .join (env_install_path , "bin" , lib_full_name ())
112+ )
111113 else :
112- # Set the kcl lib and open it.
113- path = lib_path ()
114- path_env = os .environ .get ("PATH" , "" )
115- bin_path_str = str (path )
116- new_path_env = f"{ path_env } { os .pathsep } { bin_path_str } "
117- os .environ ["PATH" ] = new_path_env
118- os .environ [KCLVM_CLI_BIN_PATH_ENV_VAR ] = bin_path_str
119- self .lib = ctypes .CDLL (os .path .join (path , lib_full_name ()))
114+ # Install temp path.
115+ install_kclvm (self ._dir .name )
116+ self .lib = ctypes .CDLL (self ._dir .name + "/bin/" + lib_full_name ())
120117 # Assuming the shared library exposes a function `kclvm_service_new`
121118 self .lib .kclvm_service_new .argtypes = [ctypes .c_uint64 ]
122119 self .lib .kclvm_service_new .restype = ctypes .c_void_p
Original file line number Diff line number Diff line change 1- def test_parse_api ():
1+ def test_exec_api ():
22 import kcl_lib .api as api
33
44 # Call the `exec_program` method with appropriate arguments
You can’t perform that action at this time.
0 commit comments