Skip to content
Snippets Groups Projects
Commit 80dc6493 authored by Jamie Forth's avatar Jamie Forth
Browse files

don’t look for plux library if already on sys.path

parent 1b2afbf9
Branches
No related merge requests found
......@@ -26,10 +26,12 @@ if platform.mac_ver()[0] != "":
)
sys.exit(1)
base_path = importlib.util.find_spec("plux").submodule_search_locations
if base_path is not None and len(base_path) == 1:
plux_path = f"{base_path[0]}/PLUX-API-Python3/{osDic[platform.system()]}"
print(f"Found plux lib: {plux_path}")
sys.path.append(plux_path)
else:
print("Could not find plux lib, should be in bitalino/src/plux/.")
spec = importlib.util.find_spec("plux")
if spec.loader is None:
base_path = spec.submodule_search_locations
if base_path is not None and len(base_path) == 1:
plux_path = f"{base_path[0]}/PLUX-API-Python3/{osDic[platform.system()]}"
print(f"Found plux lib: {plux_path}")
sys.path.append(plux_path)
else:
print("Could not find plux lib, should be in bitalino/src/plux/.")
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment