We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6690f9f commit 3c58fb9Copy full SHA for 3c58fb9
tests/tests/util/prebuilt/libsecp256k1.dylib
448 KB
tests/tests/util/secp256k1.py
@@ -1,4 +1,4 @@
1
-import ctypes, os
+import ctypes, os, sys
2
import ctypes.util
3
4
from ctypes import (
@@ -17,6 +17,12 @@
17
18
def _init(flags = (CONTEXT_SIGN | CONTEXT_VERIFY)):
19
library_path = ctypes.util.find_library('libsecp256k1')
20
+ if library_path is None:
21
+ CURRENT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)))
22
+ if sys.platform == 'darwin':
23
+ library_path = os.path.abspath(os.path.join(CURRENT_DIR, "prebuilt/libsecp256k1.dylib"))
24
+ else:
25
+ library_path = os.path.abspath(os.path.join(CURRENT_DIR, "prebuilt/libsecp256k1.so"))
26
27
secp256k1 = ctypes.cdll.LoadLibrary(library_path)
28
0 commit comments