From 9fa724b192810ede9e5bc5983fec63501162240a Mon Sep 17 00:00:00 2001 From: Vlad Gheorghiu Date: Fri, 1 Dec 2023 15:38:12 -0500 Subject: [PATCH] fixed shared lib detection code --- oqs/oqs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/oqs/oqs.py b/oqs/oqs.py index 67a4820..76e5e1b 100644 --- a/oqs/oqs.py +++ b/oqs/oqs.py @@ -20,12 +20,19 @@ def _load_shared_obj(name): - """Attempts to load native OQS library.""" + """Attempts to load shared library.""" paths = [] # search typical locations - paths += [ctu.find_library(name)] - paths += [ctu.find_library("lib" + name)] + try: + paths += [ctu.find_library(name)] + except FileNotFoundError: + pass + try: + paths += [ctu.find_library("lib" + name)] + except FileNotFoundError: + pass + dll = ct.windll if platform.system() == "Windows" else ct.cdll for path in paths: