From 5dffd774910d5f645d7efb9280904a6470934ed6 Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 21 Dec 2023 09:51:22 -0600 Subject: [PATCH] (fix) catch PackageNotFoundError when detecting system libsecp256k1 --- setup_support.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup_support.py b/setup_support.py index 2a526435a..32d72ba12 100644 --- a/setup_support.py +++ b/setup_support.py @@ -5,6 +5,7 @@ import sys from contextlib import contextmanager, suppress from distutils.extension import Extension +from importlib.metadata import PackageNotFoundError from tempfile import mkdtemp import pkgconfig @@ -81,7 +82,7 @@ def _find_lib(): ffi.dlopen('secp256k1') return os.path.exists(os.path.join(package_info['include_dirs'][0], 'secp256k1_ecdh.h')) - except OSError: + except (OSError, PackageNotFoundError): if 'LIB_DIR' in os.environ: for path in glob.glob(os.path.join(os.environ['LIB_DIR'], '*secp256k1*')): with suppress(OSError):