Skip to content

Commit

Permalink
make hack numpy 1.16 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
adrn committed Jun 15, 2020
1 parent f008bc2 commit b7ba1d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thejoker/utils.py
Expand Up @@ -271,7 +271,10 @@ def wrapper(*args, **kwargs):
def random_state_context(random_state):
state = np.random.get_state()
if random_state is not None:
np.random.seed(random_state.integers(2**32-1)) # HACK
try:
np.random.seed(random_state.integers(2**32-1)) # HACK
except AttributeError:
np.random.seed(random_state.randint(2**32-1)) # HACK
try:
yield
finally:
Expand Down

0 comments on commit b7ba1d0

Please sign in to comment.