aboutsummaryrefslogtreecommitdiffstats
path: root/src/python/botan2.py
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-11-20 07:10:24 -0500
committerJack Lloyd <[email protected]>2020-11-20 07:10:24 -0500
commit431c8bee7c74e0ec400a2f7a18cebcdcdd029dd1 (patch)
treef7b7027952e09d13c37e29dd25f2931b8ee9dfb1 /src/python/botan2.py
parentb763b348a704decd755172fec112c8f965f0f94c (diff)
Fix Python when loading a shared object without ffi module [ci skip]
Don't crash
Diffstat (limited to 'src/python/botan2.py')
-rwxr-xr-xsrc/python/botan2.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/python/botan2.py b/src/python/botan2.py
index 78bc27934..717651d00 100755
--- a/src/python/botan2.py
+++ b/src/python/botan2.py
@@ -70,10 +70,11 @@ def _load_botan_dll(expected_version):
for dll_name in possible_dll_names:
try:
dll = CDLL(dll_name)
- dll.botan_ffi_supports_api.argtypes = [c_uint32]
- dll.botan_ffi_supports_api.restype = c_int
- if dll.botan_ffi_supports_api(expected_version) == 0:
- return dll
+ if hasattr(dll, 'botan_ffi_supports_api'):
+ dll.botan_ffi_supports_api.argtypes = [c_uint32]
+ dll.botan_ffi_supports_api.restype = c_int
+ if dll.botan_ffi_supports_api(expected_version) == 0:
+ return dll
except OSError:
pass