Skip to content

Commit 74e3abe

Browse files
WIP modify sys.path
1 parent e1c60d4 commit 74e3abe

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

python/chilldkg_ref/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
import sys
2+
3+
14
__all__ = ["chilldkg"]
5+
6+
# Prefer the vendored copy of secp256k1proto.
7+
sys.path.append("secp256k1proto/src")

python/tests.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
from typing import Tuple, List, Optional
88
from secrets import token_bytes as random_bytes
99

10-
from secp256k1proto.secp256k1 import GE, G, Scalar
11-
from secp256k1proto.keys import pubkey_gen_plain
12-
1310
from chilldkg_ref.util import (
1411
FaultyParticipantOrCoordinatorError,
1512
FaultyCoordinatorError,
@@ -21,6 +18,11 @@
2118
import chilldkg_ref.encpedpop as encpedpop
2219
import chilldkg_ref.chilldkg as chilldkg
2320

21+
# Import from secp256k1proto after the chilldkg_ref imports because the latter
22+
# modifies sys.path to make sure the vendored copy of secp256k1proto is found.
23+
from secp256k1proto.secp256k1 import GE, G, Scalar
24+
from secp256k1proto.keys import pubkey_gen_plain
25+
2426
from example import simulate_chilldkg_full as simulate_chilldkg_full_example
2527

2628

0 commit comments

Comments
 (0)