Skip to content

Commit

Permalink
Search for correct library extension on mac os
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Comte committed Jul 8, 2020
1 parent 6e6bf0a commit 3ed4e88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jmbitcoin/jmbitcoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# if not, it is assumed to be present at the system level
# See: https://github.com/Simplexum/python-bitcointx/commit/79333106eeb55841df2935781646369b186d99f7#diff-1ea6586127522e62d109ec5893a18850R301-R310
import os, sys
expected_secp_location = os.path.join(sys.prefix, "lib", "libsecp256k1.so")
if sys.platform == "darwin":
secp_name = "libsecp256k1.dylib"
else:
secp_name = "libsecp256k1.so"
expected_secp_location = os.path.join(sys.prefix, "lib", secp_name)
if os.path.exists(expected_secp_location):
import bitcointx
bitcointx.set_custom_secp256k1_path(expected_secp_location)
Expand Down

0 comments on commit 3ed4e88

Please sign in to comment.