Skip to content

Commit

Permalink
(fix) catch PackageNotFoundError when detecting system libsecp256k1
Browse files Browse the repository at this point in the history
  • Loading branch information
MementoRC committed Dec 21, 2023
1 parent bd0afe0 commit 5dffd77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 5dffd77

Please sign in to comment.