summarylogtreecommitdiffstats
path: root/leapc-python-api-init.patch
blob: 890afc18c0f341211cb7725c5a06fa61b10137b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/leapc-python-api/src/leap/__init__.py b/leapc-python-api/src/leap/__init__.py
index 58031cd..d4647ef 100644
--- a/leapc-python-api/src/leap/__init__.py
+++ b/leapc-python-api/src/leap/__init__.py
@@ -62,27 +62,12 @@ cffi_location = _OS_DEFAULT_CFFI_INSTALL_LOCATION[get_system()]
 if _OVERRIDE_LEAPSDK_LOCATION is not None:
     cffi_location = _OVERRIDE_LEAPSDK_LOCATION
 
-cffi_path = os.path.join(cffi_location, "leapc_cffi")
-if os.path.isdir(cffi_path):
-    ret = check_required_files(cffi_path)
-
-    # TODO: If we can't find leapc_cffi, we could try building it
-
-    sys.path.append(cffi_location)
-
-    try:
-        from leapc_cffi import ffi, libleapc
-    except ImportError as import_error:
-        if not ret:
-            error_msg = f"Missing required files within {cffi_location}."
-        else:
-            error_msg = f"Unknown error, please consult readme for help. Attempting to find leapc_cffi within {cffi_location}"
-        raise ImportError(
-            f"Cannot import leapc_cffi: {error_msg}. Caught ImportError: {import_error}"
-        )
-else:
-    error_msg = f"Error: Unable to find leapc_cffi dir within directory {cffi_location}"
-    raise Exception(error_msg)
+try:
+    from leapc_cffi import ffi, libleapc
+except ImportError as import_error:
+    raise ImportError(
+        f"Cannot import leapc_cffi. Caught ImportError: {import_error}"
+    )
 
 from .functions import (
     get_now,